Skip to content

Commit c92ade4

Browse files
committed
clarify
1 parent 56532a3 commit c92ade4

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

src/audits/server.ts

+14-11
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export function serverAudits(opts: ServerAuditOptions): Audit[] {
115115
throw new AuditError(res, 'Response body is not UTF-8 encoded');
116116
}
117117
}),
118-
audit('MUST accept utf-8 encoding', async () => {
118+
audit('MUST accept utf-8 encoded request', async () => {
119119
const res = await fetchFn(await getUrl(opts.url), {
120120
method: 'POST',
121121
headers: {
@@ -126,17 +126,20 @@ export function serverAudits(opts: ServerAuditOptions): Audit[] {
126126

127127
ressert(res).status.toBe(200);
128128
}),
129-
audit('MUST assume utf-8 if encoding is unspecified', async () => {
130-
const res = await fetchFn(await getUrl(opts.url), {
131-
method: 'POST',
132-
headers: {
133-
'content-type': 'application/json',
134-
},
135-
body: JSON.stringify({ query: '{ __typename }' }),
136-
});
129+
audit(
130+
'MUST assume utf-8 in request if encoding is unspecified',
131+
async () => {
132+
const res = await fetchFn(await getUrl(opts.url), {
133+
method: 'POST',
134+
headers: {
135+
'content-type': 'application/json',
136+
},
137+
body: JSON.stringify({ query: '{ __typename }' }),
138+
});
137139

138-
ressert(res).status.toBe(200);
139-
}),
140+
ressert(res).status.toBe(200);
141+
},
142+
),
140143
// Request
141144
audit('MUST accept POST requests', async () => {
142145
const res = await fetchFn(await getUrl(opts.url), {

0 commit comments

Comments
 (0)