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

Add tests for stripping port in host header #591

Merged
merged 1 commit into from Aug 25, 2018

Conversation

szmarczak
Copy link
Collaborator

Fixes #588

});

test('strip port in host header if explicit standard port (:80) & protocol (HTTP)', async t => {
const {body} = await got('http://httpbin.org:80/headers', {json: true});
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should use remote server when we can just use our local server. Using a remote endpoint slows down the tests and makes them more fragile.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Listening on 80 or 443 is likely to crash (EACCESS)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right... We could have used nock, but I guess this is good enough then.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, I forgot about nock. I'll just push a commit.

@sindresorhus sindresorhus merged commit d0757da into sindresorhus:master Aug 25, 2018
szmarczak added a commit to szmarczak/got that referenced this pull request Aug 28, 2018
@szmarczak szmarczak deleted the strip-port branch January 17, 2019 18:55
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

Successfully merging this pull request may close these issues.

None yet

2 participants