File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -357,13 +357,17 @@ function extractQueryParams(
357357 originalUrl = `http://dogs.are.great${ originalUrl } ` ;
358358 }
359359
360- return (
361- req . query ||
362- ( typeof URL !== undefined && new URL ( originalUrl ) . search . replace ( '?' , '' ) ) ||
363- // In Node 8, `URL` isn't in the global scope, so we have to use the built-in module from Node
364- ( deps && deps . url && deps . url . parse ( originalUrl ) . query ) ||
365- undefined
366- ) ;
360+ try {
361+ return (
362+ req . query ||
363+ ( typeof URL !== undefined && new URL ( originalUrl ) . search . slice ( 1 ) ) ||
364+ // In Node 8, `URL` isn't in the global scope, so we have to use the built-in module from Node
365+ ( deps && deps . url && deps . url . parse ( originalUrl ) . query ) ||
366+ undefined
367+ ) ;
368+ } catch {
369+ return undefined ;
370+ }
367371}
368372
369373/**
You can’t perform that action at this time.
0 commit comments