From: Fabian Keil Date: Fri, 8 Dec 2006 12:39:13 +0000 (+0000) Subject: Let get_last_url() catch https URLs as well. X-Git-Tag: v_3_0_7~466 X-Git-Url: http://www.privoxy.org/gitweb/user-manual/copyright.html?a=commitdiff_plain;h=6214863ee264cc161a06bc58af5eec98714194c1;p=privoxy.git Let get_last_url() catch https URLs as well. --- diff --git a/filters.c b/filters.c index 37340558..edead9da 100644 --- a/filters.c +++ b/filters.c @@ -1,4 +1,4 @@ -const char filters_rcs[] = "$Id: filters.c,v 1.67 2006/11/28 15:19:43 fabiankeil Exp $"; +const char filters_rcs[] = "$Id: filters.c,v 1.68 2006/12/05 14:45:48 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/filters.c,v $ @@ -40,6 +40,10 @@ const char filters_rcs[] = "$Id: filters.c,v 1.67 2006/11/28 15:19:43 fabiankeil * * Revisions : * $Log: filters.c,v $ + * Revision 1.68 2006/12/05 14:45:48 fabiankeil + * Make sure get_last_url() behaves like advertised + * and fast-redirects{} can be combined with redirect{}. + * * Revision 1.67 2006/11/28 15:19:43 fabiankeil * Implemented +redirect{s@foo@bar@} to generate * a redirect based on a rewritten version of the @@ -1270,7 +1274,7 @@ char *get_last_url(char *subject, const char *redirect_mode) subject = new_url; } - log_error(LOG_LEVEL_REDIRECTS, "Checking \"%s\" for redirects", subject); + log_error(LOG_LEVEL_REDIRECTS, "Checking \"%s\" for redirects.", subject); /* * Find the last URL encoded in the request @@ -1280,8 +1284,15 @@ char *get_last_url(char *subject, const char *redirect_mode) { new_url = tmp++; } + tmp = new_url; + while ((tmp = strstr(tmp, "https://")) != NULL) + { + new_url = tmp++; + } - if (new_url != subject || (0 == strncmpic(subject, "http://", 7))) + if ((new_url != subject) + || (0 == strncmpic(subject, "http://", 7)) + || (0 == strncmpic(subject, "https://", 8))) { /* * Return new URL if we found a redirect