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() {
111
111
this . responseXML = "" ;
112
112
this . status = null ;
113
113
this . statusText = null ;
114
-
114
+
115
115
// Whether cross-site Access-Control requests should be made using
116
116
// credentials such as cookies or authorization headers
117
117
this . withCredentials = false ;
@@ -343,6 +343,10 @@ exports.XMLHttpRequest = function() {
343
343
344
344
// Set the Host header or the server may reject the request
345
345
headers . Host = host ;
346
+ // IPv6 addresses must be escaped with brackets
347
+ if ( url . host [ 0 ] === "[" ) {
348
+ headers . Host = "[" + headers . Host + "]" ;
349
+ }
346
350
if ( ! ( ( ssl && port === 443 ) || port === 80 ) ) {
347
351
headers . Host += ":" + url . port ;
348
352
}
You can’t perform that action at this time.
0 commit comments