File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -300,13 +300,14 @@ export function createHandler<RawRequest = unknown>(
300
300
case method === 'GET' : {
301
301
// TODO: what if content-type is specified and is not application/x-www-form-urlencoded?
302
302
try {
303
- const url = new URL ( req . url || '' , 'http://localhost/' ) ;
303
+ const [ , search ] = req . url . split ( '?' ) ;
304
+ const searchParams = new URLSearchParams ( search ) ;
304
305
partParams . operationName =
305
- url . searchParams . get ( 'operationName' ) ?? undefined ;
306
- partParams . query = url . searchParams . get ( 'query' ) ?? undefined ;
307
- const variables = url . searchParams . get ( 'variables' ) ;
306
+ searchParams . get ( 'operationName' ) ?? undefined ;
307
+ partParams . query = searchParams . get ( 'query' ) ?? undefined ;
308
+ const variables = searchParams . get ( 'variables' ) ;
308
309
if ( variables ) partParams . variables = JSON . parse ( variables ) ;
309
- const extensions = url . searchParams . get ( 'extensions' ) ;
310
+ const extensions = searchParams . get ( 'extensions' ) ;
310
311
if ( extensions ) partParams . extensions = JSON . parse ( extensions ) ;
311
312
} catch {
312
313
throw new Error ( 'Unparsable URL' ) ;
You can’t perform that action at this time.
0 commit comments