release: promote develop → main (staging) #5

Merged
chrnx merged 164 commits from develop into main 2026-07-18 19:01:55 +00:00
2 changed files with 16 additions and 0 deletions
Showing only changes of commit 2bbc43505e - Show all commits

No files matched your search

+2
View File
@@ -207,6 +207,8 @@ export function createHttpServer(
res.end(JSON.stringify({ error: 'Invalid JSON body' }));
return;
}
} else if (raw !== undefined && ct.includes('application/x-www-form-urlencoded')) {
body = Object.fromEntries(new URLSearchParams(raw));
}
let result: PipelineResult;
try {
+14
View File
@@ -137,4 +137,18 @@ describe('request hardening', () => {
expect(text).toContain('data: {"n":3}');
server.close();
});
it('parses application/x-www-form-urlencoded into an object body', async () => {
const getUrl = (s: import('http').Server) => `http://127.0.0.1:${(s.address() as any).port}`;
const server = createHttpServer([{
method: 'POST', pattern: '/form', transport: 'buffer',
handler: async (req) => ({ status: 200, headers: { 'content-type': 'application/json' }, body: JSON.stringify(req.body) }),
}]);
await new Promise<void>((r) => server.listen(0, r));
const res = await fetch(`${getUrl(server)}/form`, {
method: 'POST', headers: { 'content-type': 'application/x-www-form-urlencoded' }, body: 'a=1&b=two',
});
expect(await res.json()).toEqual({ a: '1', b: 'two' });
server.close();
});
});