parse_http_url(): Only hide the path if FEATURE_HTTPS_INSPECTION in unavailable
authorFabian Keil <fk@fabiankeil.de>
Fri, 28 Feb 2020 08:33:25 +0000 (09:33 +0100)
committerFabian Keil <fk@fabiankeil.de>
Mon, 1 Jun 2020 08:06:41 +0000 (10:06 +0200)
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

urlmatch.c

index 2bd5a8f..6949eed 100644 (file)
@@ -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);
       }