We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71c4d88 commit 2c64eb9Copy full SHA for 2c64eb9
1 file changed
scapy/layers/http.py
@@ -885,7 +885,13 @@ def request(
885
self._connect_or_reuse(host, port=port, tls=tls, timeout=timeout)
886
887
# Build request
888
- headers.setdefault("Host", host)
+ if ((tls and port != 443) or
889
+ (not tls and port != 80)):
890
+ host_hdr = "%s:%d" % (host, port)
891
+ else:
892
+ host_hdr = host
893
+
894
+ headers.setdefault("Host", host_hdr)
895
headers.setdefault("Path", path)
896
897
if not http_headers:
0 commit comments