File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -586,6 +586,21 @@ export function serverAudits(opts: ServerAuditOptions): Audit[] {
586
586
ressert ( res ) . status . toBe ( 400 ) ;
587
587
} ,
588
588
) ,
589
+ audit (
590
+ 'B7N8' ,
591
+ 'SHOULD use 400 status code on JSON parsing failure when accepting application/graphql-response+json' ,
592
+ async ( ) => {
593
+ const res = await fetchFn ( await getUrl ( opts . url ) , {
594
+ method : 'POST' ,
595
+ headers : {
596
+ 'content-type' : 'application/json' ,
597
+ accept : 'application/graphql-response+json' ,
598
+ } ,
599
+ body : '{ "not a JSON' ,
600
+ } ) ;
601
+ ressert ( res ) . status . toBe ( 400 ) ;
602
+ } ,
603
+ ) ,
589
604
audit (
590
605
'8764' ,
591
606
'MAY use 4xx or 5xx status codes if parameters are invalid' ,
Original file line number Diff line number Diff line change @@ -194,6 +194,10 @@ exports[`should not change globally unique audit ids 1`] = `
194
194
" id" : " BCF8" ,
195
195
" name" : " MAY use 400 status code on JSON parsing failure" ,
196
196
} ,
197
+ {
198
+ " id" : " B7N8" ,
199
+ " name" : " SHOULD use 400 status code on JSON parsing failure when accepting application/graphql-response+json" ,
200
+ } ,
197
201
{
198
202
" id" : " 8764" ,
199
203
" name" : " MAY use 4xx or 5xx status codes if parameters are invalid" ,
You can’t perform that action at this time.
0 commit comments