From b40487eec42668166a0dd9feb10626a03faea635 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Fri, 28 Feb 2020 09:33:25 +0100 Subject: [PATCH] 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 --- urlmatch.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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); } -- 2.39.2