Skip to content

fix(audits): avoid false positives in 9ABE #148

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/audits/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,11 @@ 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',
body: JSON.stringify({ query: '{ __typename }' }),
});
ressert(res).status.toBeBetween(400, 499);
},
Expand Down
2 changes: 1 addition & 1 deletion tests/__snapshots__/audits.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading