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

Fix header tests #2993

Merged
merged 1 commit into from Aug 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 4 additions & 8 deletions tests/test-headers.js
Expand Up @@ -193,8 +193,7 @@ tape('preserve port in host header if non-standard port', function (t) {
tape('strip port in host header if explicit standard port (:80) & protocol (HTTP)', function (t) {
var r = request({
url: 'http://localhost:80/headers.json'
}, function (err, res, body) {
t.notEqual(err, null)
}, function (_err, res, body) {
t.equal(r.req.socket._host, 'localhost')
t.end()
})
Expand All @@ -203,8 +202,7 @@ tape('strip port in host header if explicit standard port (:80) & protocol (HTTP
tape('strip port in host header if explicit standard port (:443) & protocol (HTTPS)', function (t) {
var r = request({
url: 'https://localhost:443/headers.json'
}, function (err, res, body) {
t.notEqual(err, null)
}, function (_err, res, body) {
t.equal(r.req.socket._host, 'localhost')
t.end()
})
Expand All @@ -213,8 +211,7 @@ tape('strip port in host header if explicit standard port (:443) & protocol (HTT
tape('strip port in host header if implicit standard port & protocol (HTTP)', function (t) {
var r = request({
url: 'http://localhost/headers.json'
}, function (err, res, body) {
t.notEqual(err, null)
}, function (_err, res, body) {
t.equal(r.req.socket._host, 'localhost')
t.end()
})
Expand All @@ -223,8 +220,7 @@ tape('strip port in host header if implicit standard port & protocol (HTTP)', fu
tape('strip port in host header if implicit standard port & protocol (HTTPS)', function (t) {
var r = request({
url: 'https://localhost/headers.json'
}, function (err, res, body) {
t.notEqual(err, null)
}, function (_err, res, body) {
t.equal(r.req.socket._host, 'localhost')
t.end()
})
Expand Down