[libsoup] soup-cookie-jar: allow setting cookies on file:// URIs



commit b355e0c224b165d9227fb2a07795178c6e0de8ac
Author: Dan Winship <danw gnome org>
Date:   Sat Dec 11 11:31:59 2010 +0100

    soup-cookie-jar: allow setting cookies on file:// URIs
    
    Because other browsers do, and WebKit has a test for it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=603825

 libsoup/soup-cookie-jar.c |    6 +++---
 libsoup/soup-cookie.c     |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/libsoup/soup-cookie-jar.c b/libsoup/soup-cookie-jar.c
index adb50ec..c1735dc 100644
--- a/libsoup/soup-cookie-jar.c
+++ b/libsoup/soup-cookie-jar.c
@@ -330,7 +330,7 @@ soup_cookie_jar_get_cookies (SoupCookieJar *jar, SoupURI *uri,
 	priv = SOUP_COOKIE_JAR_GET_PRIVATE (jar);
 	g_return_val_if_fail (uri != NULL, NULL);
 
-	if (!SOUP_URI_VALID_FOR_HTTP (uri))
+	if (!uri->host)
 		return NULL;
 
 	/* The logic here is a little weird, but the plan is that if
@@ -486,7 +486,7 @@ soup_cookie_jar_set_cookie (SoupCookieJar *jar, SoupURI *uri,
 	g_return_if_fail (uri != NULL);
 	g_return_if_fail (cookie != NULL);
 
-	if (!SOUP_URI_VALID_FOR_HTTP (uri))
+	if (!uri->host)
 		return;
 
 	priv = SOUP_COOKIE_JAR_GET_PRIVATE (jar);
@@ -530,7 +530,7 @@ soup_cookie_jar_set_cookie_with_first_party (SoupCookieJar *jar,
 	g_return_if_fail (first_party != NULL);
 	g_return_if_fail (cookie != NULL);
 
-	if (!SOUP_URI_VALID_FOR_HTTP (uri))
+	if (!uri->host)
 		return;
 
 	priv = SOUP_COOKIE_JAR_GET_PRIVATE (jar);
diff --git a/libsoup/soup-cookie.c b/libsoup/soup-cookie.c
index d73e1b5..5e50043 100644
--- a/libsoup/soup-cookie.c
+++ b/libsoup/soup-cookie.c
@@ -213,7 +213,7 @@ parse_one_cookie (const char *header, SoupURI *origin)
 	gboolean has_value;
 	SoupCookie *cookie;	
 
-	g_return_val_if_fail (origin == NULL || SOUP_URI_VALID_FOR_HTTP (origin), NULL);
+	g_return_val_if_fail (origin == NULL || origin->host, NULL);
 
 	cookie = g_slice_new0 (SoupCookie);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]