mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: Prevent HttpRequest from being closed
In case a stream the request is being piped into closes, we don't want to close the request since it shares a socket with the response.
This commit is contained in:
@@ -68,6 +68,18 @@ describe('A Solid server', (): void => {
|
||||
expect(res.status).toBe(205);
|
||||
});
|
||||
|
||||
it('can handle PUT errors.', async(): Promise<void> => {
|
||||
// There was a specific case where the following request caused the connection to close instead of error
|
||||
const res = await fetch(baseUrl, {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'content-type': 'text/plain',
|
||||
},
|
||||
body: '"test"',
|
||||
});
|
||||
expect(res.status).toBe(400);
|
||||
});
|
||||
|
||||
it('can POST to create a container.', async(): Promise<void> => {
|
||||
const res = await fetch(baseUrl, {
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user