Skip to content

Instantly share code, notes, and snippets.

@bct
Created June 6, 2009 01:26
Show Gist options
  • Save bct/124620 to your computer and use it in GitHub Desktop.
Save bct/124620 to your computer and use it in GitHub Desktop.
/* from soup-cookie-jar.c in libsoup */
static void
request_started (SoupSessionFeature *feature, SoupSession *session,
SoupMessage *msg, SoupSocket *socket)
{
SoupCookieJar *jar = SOUP_COOKIE_JAR (feature);
char *cookies;
cookies = soup_cookie_jar_get_cookies (jar, soup_message_get_uri (msg), TRUE);
if (cookies) {
soup_message_headers_replace (msg->request_headers,
"Cookie", cookies);
g_free (cookies);
} else
soup_message_headers_remove (msg->request_headers, "Cookie");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment