souphttpsrc: Fix cookies property

Disable session sharing and cookie jar when cookies property is set.

The cookie jar actually replaces or removes any existing Cookie header
set on the message, so the cookies property was effectively being
ignored. There doesn't appear to be a way to inject the cookies into the
jar without having to specify matching domains etc., so it's not
possible to simulate the old behaviour of unconditionally sending the
cookies with all messages, besides simply disabling the cookie jar.
This commit is contained in:
Jake Barnes 2020-02-19 15:59:19 +11:00 committed by GStreamer Merge Bot
parent 2d3dccdba7
commit 2ffb52499f

View file

@ -919,6 +919,7 @@ gst_soup_http_src_session_open (GstSoupHTTPSrc * src)
if (!src->session) {
GstQuery *query;
gboolean can_share = (src->timeout == DEFAULT_TIMEOUT)
&& (src->cookies == NULL)
&& (src->ssl_strict == DEFAULT_SSL_STRICT)
&& (src->tls_interaction == NULL) && (src->proxy == NULL)
&& (src->tls_database == DEFAULT_TLS_DATABASE)
@ -1502,6 +1503,8 @@ gst_soup_http_src_build_message (GstSoupHTTPSrc * src, const gchar * method)
soup_message_headers_append (src->msg->request_headers, "Cookie",
*cookie);
}
soup_message_disable_feature (src->msg, SOUP_TYPE_COOKIE_JAR);
}
if (!src->compress)