File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ exports.XMLHttpRequest = function() {
111111 this . responseXML = "" ;
112112 this . status = null ;
113113 this . statusText = null ;
114-
114+
115115 // Whether cross-site Access-Control requests should be made using
116116 // credentials such as cookies or authorization headers
117117 this . withCredentials = false ;
@@ -343,6 +343,10 @@ exports.XMLHttpRequest = function() {
343343
344344 // Set the Host header or the server may reject the request
345345 headers . Host = host ;
346+ // IPv6 addresses must be escaped with brackets
347+ if ( url . host [ 0 ] === "[" ) {
348+ headers . Host = "[" + headers . Host + "]" ;
349+ }
346350 if ( ! ( ( ssl && port === 443 ) || port === 80 ) ) {
347351 headers . Host += ":" + url . port ;
348352 }
You can’t perform that action at this time.
0 commit comments