diff --git a/config/presets/middleware.json b/config/presets/middleware.json index 3f77595fc..e4978027b 100644 --- a/config/presets/middleware.json +++ b/config/presets/middleware.json @@ -15,6 +15,9 @@ "PUT", "PATCH", "DELETE" + ], + "CorsHandler:_options_exposedHeaders": [ + "Updates-Via" ] }, { diff --git a/test/integration/WebSocketsProtocol.test.ts b/test/integration/WebSocketsProtocol.test.ts index 80184eb81..a976aca4f 100644 --- a/test/integration/WebSocketsProtocol.test.ts +++ b/test/integration/WebSocketsProtocol.test.ts @@ -36,6 +36,12 @@ describe('A server with the Solid WebSockets API', (): void => { expect(response.headers.get('Updates-Via')).toBe(`ws://localhost:${port}`); }); + it('exposes the Updates-Via header via CORS.', async(): Promise => { + const response = await fetch(baseUrl); + expect(response.headers.get('Access-Control-Expose-Headers')!.split(',')) + .toContain('Updates-Via'); + }); + describe('when a WebSocket client connects', (): void => { let client: WebSocket; const messages = new Array();