Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not include the port number in the Host #22

Closed
gajus opened this issue Jan 24, 2017 · 2 comments
Closed

Do not include the port number in the Host #22

gajus opened this issue Jan 24, 2017 · 2 comments

Comments

@gajus
Copy link

gajus commented Jan 24, 2017

https://github.com/TooTallNate/node-https-proxy-agent/blob/6bbbef774527c8bdb5bf013d9ecc545ceaa7c974/https-proxy-agent.js#L192

This is making requests against multiple websites fail, e.g.

MacBook-Pro~ % curl 'http://www.watershed.co.uk/whatson/calendar/' -H 'Host: www.watershed.co.uk' -I
HTTP/1.1 200 OK
Date: Tue, 24 Jan 2017 21:44:16 GMT
Server: Apache/2.4.16 (FreeBSD) OpenSSL/1.0.1j-freebsd PHP/5.6.12
X-Powered-By: PHP/5.6.12
X-Drupal-Cache: MISS
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, no-transform
X-Content-Type-Options: nosniff
Content-Language: en
X-Frame-Options: SAMEORIGIN
X-UA-Compatible: IE=edge
X-Generator: Drupal 7 (http://drupal.org)
Link: <http://www.watershed.co.uk/whatson/calendar>; rel="canonical",<http://www.watershed.co.uk/whatson/calendar>; rel="shortlink"
Vary: User-Agent
Content-Type: text/html; charset=utf-8

MacBook-Pro~ % curl 'http://www.watershed.co.uk/whatson/calendar/' -H 'Host: www.watershed.co.uk:80' -I
HTTP/1.1 404 Not Found
Date: Tue, 24 Jan 2017 21:44:26 GMT
Server: Apache/2.4.25 (FreeBSD) OpenSSL/1.0.1s-freebsd
Content-Type: text/html; charset=iso-8859-1

@TooTallNate
Copy link
Owner

Patch welcome! Note that the port should only be omitted for default port 80 for HTTP and 443 for HTTPS URLs. Any other port is expected to be included in the Host header.

@bigsan
Copy link

bigsan commented Mar 9, 2018

This didn't solve the problem, the reason is explained in #43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants