summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2011-03-10 19:59:07 -0500
committerDan Winship <danw@gnome.org>2011-03-10 19:59:07 -0500
commit2ee3d2d1aef0eb6aada232dfc0c912f1b5abfbb2 (patch)
tree42171b67bfda8b2377dabc504ef5662fc814ba00
parent9dc749a34bef1f8478d94546c8132017aa3d4aff (diff)
downloadlibsoup-2ee3d2d1aef0eb6aada232dfc0c912f1b5abfbb2.tar.gz
soup-cookie-jar: avoid a g_return_if_fail when using non-http URIs
When using SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY, don't try to domain-match the cookie if the first_party URI has no domain. https://bugzilla.gnome.org/show_bug.cgi?id=643226
-rw-r--r--libsoup/soup-cookie-jar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libsoup/soup-cookie-jar.c b/libsoup/soup-cookie-jar.c
index c1735dcf..88fe7317 100644
--- a/libsoup/soup-cookie-jar.c
+++ b/libsoup/soup-cookie-jar.c
@@ -564,7 +564,7 @@ process_set_cookie_header (SoupMessage *msg, gpointer user_data)
SoupURI *first_party = soup_message_get_first_party (msg);
if ((priv->accept_policy == SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY &&
- first_party != NULL &&
+ first_party != NULL && first_party->host &&
soup_cookie_domain_matches (nc->data, first_party->host)) ||
priv->accept_policy == SOUP_COOKIE_JAR_ACCEPT_ALWAYS)
soup_cookie_jar_add_cookie (jar, nc->data);