-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
#515, #2894 Strip port suffix from Host header if the protocol is known. #2904
Conversation
This partially revert ff6d6c6, and still works for IPv6 addresses as well.
Tests seem to be failing because of the travis-ci/travis-ci#8361 (comment) proposes a possible fix, but would require using Further reading - https://docs.travis-ci.com/user/reference/overview/#Virtualisation-Environment-vs-Operating-System |
@mikeal @simov This is also very similar to the recent NPM 418 errors discussed here and here - npm/npm#20791 |
This must be a regression, we used to take care of this by using the property from url.parse that doesn't include the header on known protocols. Any idea when this might have happened? Can you disable the IPv6 test since it doesn't work in Travis? |
@mikeal I just checked, and the last CI runs are all green.
From what I can tell, this happened in #2571, here - https://github.com/request/request/pull/2571/files#diff-ccc0734f65dd7a299409ff07d35be095L293 |
Ah, thanks, too bad that regression snuck in :( |
Sorry, guys! |
@mikeal This PR should fix #515 and #2894.
PR Checklist:
npm test
locally and all tests are passing.PR Description
It drops the port suffix in the
Host
header for standard protocol + port combinations (HTTP +:80
and HTTPS +:443
). It partially reverts ff6d6c6, while still working for IPv6 addresses.CC: @JamesMGreene, @simov