From a768df3e915fff2d9ef53517c6ba7fee23e98355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Tue, 27 Nov 2018 16:23:17 +0000 Subject: [PATCH] When deciding whether to send the complete URL or just the document part, we were looking at the original URL rather than the one we were currently processing. This meant that if we were trying to retrieve an HTTP URL but were redirected to an HTTPS URL, and HTTPS proxying was enabled, we would send an invalid request and most likely get garbage back. MFC after: 3 days --- lib/libfetch/http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c index 96821160b67..97788ddc32a 100644 --- a/lib/libfetch/http.c +++ b/lib/libfetch/http.c @@ -1617,7 +1617,7 @@ http_request_body(struct url *URL, const char *op, struct url_stat *us, if (verbose) fetch_info("requesting %s://%s%s", url->scheme, host, url->doc); - if (purl && strcmp(URL->scheme, SCHEME_HTTPS) != 0) { + if (purl && strcmp(url->scheme, SCHEME_HTTPS) != 0) { http_cmd(conn, "%s %s://%s%s HTTP/1.1", op, url->scheme, host, url->doc); } else {