From: Fabian Keil <fk@fabiankeil.de>
Date: Fri, 28 Feb 2020 08:33:25 +0000 (+0100)
Subject: parse_http_url(): Only hide the path if FEATURE_HTTPS_INSPECTION in unavailable
X-Git-Tag: v_3_0_29~364
X-Git-Url: http://www.privoxy.org/gitweb/user-manual/faq/@default-cgi@toggle?a=commitdiff_plain;h=b40487eec42668166a0dd9feb10626a03faea635;p=privoxy.git

parse_http_url(): Only hide the path if FEATURE_HTTPS_INSPECTION in unavailable

This is relevant for the show-url-info CGI page
which should consider the whole URL when matching
with FEATURE_HTTPS_INSPECTION available.

Sponsored by: Robert Klemme
---

diff --git a/urlmatch.c b/urlmatch.c
index 2bd5a8f8..6949eedb 100644
--- a/urlmatch.c
+++ b/urlmatch.c
@@ -291,12 +291,17 @@ jb_err parse_http_url(const char *url, struct http_request *http, int require_pr
          /*
           * Got a path.
           *
-          * NOTE: The following line ignores the path for HTTPS URLS.
-          * This means that you get consistent behaviour if you type a
-          * https URL in and it's parsed by the function.  (When the
-          * URL is actually retrieved, SSL hides the path part).
+          * If FEATURE_HTTPS_INSPECTION isn't available, ignore the
+          * path for https URLs so that we get consistent behaviour
+          * if a https URL is parsed. When the URL is actually
+          * retrieved, https hides the path part.
           */
-         http->path = strdup_or_die(http->ssl ? "/" : url_path);
+         http->path = strdup_or_die(
+#ifndef FEATURE_HTTPS_INSPECTION
+            http->ssl ? "/" :
+#endif
+            url_path
+         );
          *url_path = '\0';
          http->hostport = strdup_or_die(url_noproto);
       }