Skip to content

Commit 06d2da8

Browse files
committed
Bug fix: Host header bad setted, missing port
If the user is requesting a server using any port but 80, the response from the server will have a wrong Location header, so the client won't be able to use it. According to the RFC the Host header is composed of hostname:port
1 parent e692c12 commit 06d2da8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/XMLHttpRequest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ exports.XMLHttpRequest = function() {
275275
var uri = url.pathname + (url.search ? url.search : '');
276276

277277
// Set the Host header or the server may reject the request
278-
headers["Host"] = host;
278+
headers["Host"] = host + ':' + url.port;
279279

280280
// Set Basic Auth if necessary
281281
if (settings.user) {

0 commit comments

Comments
 (0)