File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ module.exports = {
257
257
if ( ! host ) host = this . get ( 'Host' ) ;
258
258
}
259
259
if ( ! host ) return '' ;
260
- return host . split ( / \s * , \s * / ) [ 0 ] ;
260
+ return host . split ( / \s * , \s * / , 1 ) [ 0 ] ;
261
261
} ,
262
262
263
263
/**
@@ -273,7 +273,7 @@ module.exports = {
273
273
const host = this . host ;
274
274
if ( ! host ) return '' ;
275
275
if ( '[' == host [ 0 ] ) return this . URL . hostname || '' ; // IPv6
276
- return host . split ( ':' ) [ 0 ] ;
276
+ return host . split ( ':' , 1 ) [ 0 ] ;
277
277
} ,
278
278
279
279
/**
@@ -404,7 +404,7 @@ module.exports = {
404
404
if ( this . socket . encrypted ) return 'https' ;
405
405
if ( ! this . app . proxy ) return 'http' ;
406
406
const proto = this . get ( 'X-Forwarded-Proto' ) ;
407
- return proto ? proto . split ( / \s * , \s * / ) [ 0 ] : 'http' ;
407
+ return proto ? proto . split ( / \s * , \s * / , 1 ) [ 0 ] : 'http' ;
408
408
} ,
409
409
410
410
/**
Original file line number Diff line number Diff line change @@ -381,7 +381,7 @@ module.exports = {
381
381
get type ( ) {
382
382
const type = this . get ( 'Content-Type' ) ;
383
383
if ( ! type ) return '' ;
384
- return type . split ( ';' ) [ 0 ] ;
384
+ return type . split ( ';' , 1 ) [ 0 ] ;
385
385
} ,
386
386
387
387
/**
You can’t perform that action at this time.
0 commit comments