diff --git a/lib/core/enums.py b/lib/core/enums.py index a176b4e91..d6608c65d 100644 --- a/lib/core/enums.py +++ b/lib/core/enums.py @@ -88,6 +88,7 @@ class HTTPHEADER: CONTENT_RANGE = "Content-Range" CONTENT_TYPE = "Content-Type" COOKIE = "Cookie" + HOST = "Host" PROXY_AUTHORIZATION = "Proxy-authorization" RANGE = "Range" REFERER = "Referer" diff --git a/lib/core/option.py b/lib/core/option.py index abed16dd4..4a528b97d 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1027,9 +1027,6 @@ def __setHTTPMethod(): logger.debug(debugMsg) def __setHTTPExtraHeaders(): - if conf.hostname: - conf.httpHeaders.append(("Host", conf.hostname)) - if conf.headers: debugMsg = "setting extra HTTP headers" logger.debug(debugMsg) diff --git a/lib/request/connect.py b/lib/request/connect.py index 5b4c4fb42..1dbdb8476 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -178,6 +178,8 @@ class Connect: if kb.proxyAuthHeader: headers[HTTPHEADER.PROXY_AUTHORIZATION] = kb.proxyAuthHeader + headers[HTTPHEADER.HOST] = urlparse.urlparse(url).netloc + if auxHeaders: for key, item in auxHeaders.items(): headers[key] = item