From: Tom Adams Date: Sun, 12 Jul 2009 20:54:21 +0000 (+0100) Subject: Add request address scheme to cookie_handler's arguments. X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=fe84dba46082f9cc949b86e2fd32c6e055aec0a0;p=uzbl-mobile Add request address scheme to cookie_handler's arguments. --- diff --git a/README b/README index ae9932b..d5db188 100644 --- a/README +++ b/README @@ -290,9 +290,10 @@ The script specific arguments are this: * cookie handler $8 GET/PUT - $9 request address host (if current page url is www.foo.com/somepage, this could be something else than foo, eg advertising from another host) - $10 request address path - $11 cookie (only with PUT requests) + $9 request address scheme (e.g. http or https) + $10 request address host (if current page url is www.foo.com/somepage, this could be something else than foo, eg advertising from another host) + $11 request address path + $12 cookie (only with PUT requests) Custom, userdefined scripts (`spawn foo bar`) get first the arguments as specified in the config and then the above 7 are added at the end. diff --git a/examples/data/uzbl/scripts/cookies.sh b/examples/data/uzbl/scripts/cookies.sh index 56b9c79..4398a03 100755 --- a/examples/data/uzbl/scripts/cookies.sh +++ b/examples/data/uzbl/scripts/cookies.sh @@ -48,6 +48,7 @@ which zenity &>/dev/null || exit 2 # uri=${uri/http:\/\/} # strip 'http://' part # host=${uri/\/*/} action=$8 # GET/PUT +shift host=$9 shift path=$9 diff --git a/uzbl.c b/uzbl.c index 193d0ba..c31b41c 100644 --- a/uzbl.c +++ b/uzbl.c @@ -2554,7 +2554,7 @@ static void handle_cookies (SoupSession *session, SoupMessage *msg, gpointer use soup_message_add_header_handler(msg, "got-headers", "Set-Cookie", G_CALLBACK(save_cookies), NULL); GString *s = g_string_new (""); SoupURI * soup_uri = soup_message_get_uri(msg); - g_string_printf(s, "GET '%s' '%s'", soup_uri->host, soup_uri->path); + g_string_printf(s, "GET '%s' '%s' '%s'", soup_uri->scheme, soup_uri->host, soup_uri->path); run_handler(uzbl.behave.cookie_handler, s->str); if(uzbl.comm.sync_stdout && strcmp (uzbl.comm.sync_stdout, "") != 0) { @@ -2577,7 +2577,7 @@ save_cookies (SoupMessage *msg, gpointer user_data){ cookie = soup_cookie_to_set_cookie_header(ck->data); SoupURI * soup_uri = soup_message_get_uri(msg); GString *s = g_string_new (""); - g_string_printf(s, "PUT '%s' '%s' '%s'", soup_uri->host, soup_uri->path, cookie); + g_string_printf(s, "PUT '%s' '%s' '%s' '%s'", soup_uri->scheme, soup_uri->host, soup_uri->path, cookie); run_handler(uzbl.behave.cookie_handler, s->str); g_free (cookie); g_string_free(s, TRUE);