mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
feat: Return correct status codes for invalid requests
This commit is contained in:
@@ -386,4 +386,14 @@ describe.each(stores)('An LDP handler allowing all requests %s', (name, { storeC
|
||||
// DELETE
|
||||
expect(await deleteResource(documentUrl)).toBeUndefined();
|
||||
});
|
||||
|
||||
it('returns 405 for unsupported methods.', async(): Promise<void> => {
|
||||
const response = await fetch(baseUrl, { method: 'TRACE' });
|
||||
expect(response.status).toBe(405);
|
||||
});
|
||||
|
||||
it('returns 415 for unsupported PATCH types.', async(): Promise<void> => {
|
||||
const response = await fetch(baseUrl, { method: 'PATCH', headers: { 'content-type': 'text/plain' }, body: 'abc' });
|
||||
expect(response.status).toBe(415);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user