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:
10
test/unit/server/HttpRequest.test.ts
Normal file
10
test/unit/server/HttpRequest.test.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { isHttpRequest } from '../../../src/server/HttpRequest';
|
||||
|
||||
describe('HttpRequest', (): void => {
|
||||
describe('#isHttpRequest', (): void => {
|
||||
it('can identify HttpRequests.', async(): Promise<void> => {
|
||||
expect(isHttpRequest({})).toBe(false);
|
||||
expect(isHttpRequest({ socket: {}, method: 'GET', url: '/url' })).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user