File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -23,18 +23,14 @@ class FastBootRequest {
2323 }
2424
2525 var host = this . headers . get ( 'host' ) ;
26-
27- var matchFound = this . hostWhitelist . reduce ( function ( previous , currentEntry ) {
28- if ( currentEntry [ 0 ] === '/' &&
29- currentEntry . slice ( - 1 ) === '/' ) {
30- // RegExp as string
31- var regexp = new RegExp ( currentEntry . slice ( 1 , - 1 ) ) ;
32-
33- return previous || regexp . test ( host ) ;
26+ var matchFound = this . hostWhitelist . some ( function ( entry ) {
27+ if ( entry [ 0 ] === '/' && entry . slice ( - 1 ) === '/' ) {
28+ var regexp = new RegExp ( entry . slice ( 1 , - 1 ) ) ;
29+ return regexp . test ( host ) ;
3430 } else {
35- return previous || currentEntry === host ;
31+ return entry === host ;
3632 }
37- } , false ) ;
33+ } ) ;
3834
3935 if ( ! matchFound ) {
4036 throw new Error ( `The host header did not match a hostWhitelist entry. Host header: ${ host } ` ) ;
You can’t perform that action at this time.
0 commit comments