Skip to content

Commit 426cc00

Browse files
committed
Fix outdated BCF8 description and headers
Relevant section: 6.4.2.1.1 JSON parsing failure https://graphql.github.io/graphql-over-http/draft/#sec-application-graphql-response-json.Examples.JSON-parsing-failure
1 parent ec2df54 commit 426cc00

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/audits/server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,12 +579,13 @@ export function serverAudits(opts: ServerAuditOptions): Audit[] {
579579
),
580580
audit(
581581
'BCF8',
582-
'MAY use 400 status code on JSON parsing failure',
582+
'SHOULD use 400 status code on JSON parsing failure when accepting application/json',
583583
async () => {
584584
const res = await fetchFn(await getUrl(opts.url), {
585585
method: 'POST',
586586
headers: {
587587
'content-type': 'application/json',
588+
accept: 'application/json',
588589
},
589590
body: '{ "not a JSON',
590591
});

tests/__snapshots__/audits.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ exports[`should not change globally unique audit ids 1`] = `
192192
},
193193
{
194194
"id": "BCF8",
195-
"name": "MAY use 400 status code on JSON parsing failure",
195+
"name": "SHOULD use 400 status code on JSON parsing failure when accepting application/json",
196196
},
197197
{
198198
"id": "8764",

0 commit comments

Comments
 (0)