From a78dbdf5b9795104517a63e59817cba8a0a776ec Mon Sep 17 00:00:00 2001 From: Jonathan Ehwald Date: Fri, 6 Jun 2025 18:44:59 +0200 Subject: [PATCH 1/3] fix(audits): avoid false positives in 9ABE --- src/audits/server.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/audits/server.ts b/src/audits/server.ts index 8612d74..165b442 100644 --- a/src/audits/server.ts +++ b/src/audits/server.ts @@ -195,6 +195,7 @@ export function serverAudits(opts: ServerAuditOptions): Audit[] { async () => { const res = await fetchFn(await getUrl(opts.url), { method: 'POST', + body: JSON.stringify({ query: '{ __typename }' }), }); ressert(res).status.toBeBetween(400, 499); }, From 0e477fef7e4e9134ebdc76a7af53e918d0aab8f7 Mon Sep 17 00:00:00 2001 From: Jonathan Ehwald Date: Fri, 6 Jun 2025 18:54:52 +0200 Subject: [PATCH 2/3] fix(audits): update 9ABE to SHOULD to match spec --- src/audits/server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audits/server.ts b/src/audits/server.ts index 165b442..d7b4f37 100644 --- a/src/audits/server.ts +++ b/src/audits/server.ts @@ -191,7 +191,7 @@ export function serverAudits(opts: ServerAuditOptions): Audit[] { // Request POST audit( '9ABE', - 'MAY respond with 4xx status code if content-type is not supplied on POST requests', + 'SHOULD respond with 4xx status code if content-type is not supplied on POST requests', async () => { const res = await fetchFn(await getUrl(opts.url), { method: 'POST', From b766aefcff26ce0a3b6dfabfdfcc6548924fe5e7 Mon Sep 17 00:00:00 2001 From: Jonathan Ehwald Date: Fri, 6 Jun 2025 19:02:38 +0200 Subject: [PATCH 3/3] chore: update snapshot --- tests/__snapshots__/audits.test.ts.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/__snapshots__/audits.test.ts.snap b/tests/__snapshots__/audits.test.ts.snap index d3c3b89..d8e9c5e 100644 --- a/tests/__snapshots__/audits.test.ts.snap +++ b/tests/__snapshots__/audits.test.ts.snap @@ -44,7 +44,7 @@ exports[`should not change globally unique audit ids 1`] = ` }, { "id": "9ABE", - "name": "MAY respond with 4xx status code if content-type is not supplied on POST requests", + "name": "SHOULD respond with 4xx status code if content-type is not supplied on POST requests", }, { "id": "03D4",