Skip to content

Commit

Permalink
Merge pull request #2993 from simov/fix-header-tests
Browse files Browse the repository at this point in the history
Fix header tests
  • Loading branch information
simov committed Aug 2, 2018
2 parents a92e138 + cd848af commit 10987ef
Showing 1 changed file with 4 additions and 8 deletions.
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

0 comments on commit 10987ef

Please sign in to comment.