unexpected-http
Advanced tools
@@ -36,3 +36,4 @@ var http = require('http'), | ||
isHttps = false, | ||
host = location.hostname || 'localhost'; | ||
host = location.hostname || 'localhost', | ||
port = location.port; | ||
if (!subject.isMessyHttpRequest) { | ||
@@ -57,3 +58,4 @@ if (typeof subject === 'string') { | ||
var urlObj = urlModule.parse(httpRequest.url); | ||
host = urlObj.host; | ||
host = urlObj.hostname; | ||
port = urlObj.port ? parseInt(urlObj.port, 10) : undefined; | ||
if (!httpRequest.headers.has('Host')) { | ||
@@ -74,3 +76,3 @@ httpRequest.headers.set('Host', urlObj.host); | ||
host: host, | ||
port: location.port || (isHttps ? 443 : 80), | ||
port: port || (isHttps ? 443 : 80), | ||
method: httpRequest.method, | ||
@@ -77,0 +79,0 @@ path: httpRequest.path, |
{ | ||
"name": "unexpected-http", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "Unexpected plugin for testing http servers", | ||
@@ -36,3 +36,3 @@ "main": "lib/unexpectedHttp.js", | ||
"underscore": "1.7.0", | ||
"unexpected-messy": "2.2.5" | ||
"unexpected-messy": "2.2.6" | ||
}, | ||
@@ -39,0 +39,0 @@ "peerDependencies": { |
13676
0.8%132
1.54%