File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ module.exports = {
257257 if ( ! host ) host = this . get ( 'Host' ) ;
258258 }
259259 if ( ! host ) return '' ;
260- return host . split ( / \s * , \s * / ) [ 0 ] ;
260+ return host . split ( / \s * , \s * / , 1 ) [ 0 ] ;
261261 } ,
262262
263263 /**
@@ -273,7 +273,7 @@ module.exports = {
273273 const host = this . host ;
274274 if ( ! host ) return '' ;
275275 if ( '[' == host [ 0 ] ) return this . URL . hostname || '' ; // IPv6
276- return host . split ( ':' ) [ 0 ] ;
276+ return host . split ( ':' , 1 ) [ 0 ] ;
277277 } ,
278278
279279 /**
@@ -404,7 +404,7 @@ module.exports = {
404404 if ( this . socket . encrypted ) return 'https' ;
405405 if ( ! this . app . proxy ) return 'http' ;
406406 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' ;
408408 } ,
409409
410410 /**
Original file line number Diff line number Diff line change @@ -381,7 +381,7 @@ module.exports = {
381381 get type ( ) {
382382 const type = this . get ( 'Content-Type' ) ;
383383 if ( ! type ) return '' ;
384- return type . split ( ';' ) [ 0 ] ;
384+ return type . split ( ';' , 1 ) [ 0 ] ;
385385 } ,
386386
387387 /**
You can’t perform that action at this time.
0 commit comments