feat: Expose Updates-Via header via CORS.

This commit is contained in:
Ruben Verborgh
2020-11-30 00:05:06 +01:00
parent 8dec921c10
commit 49d37dcd6c
2 changed files with 9 additions and 0 deletions

View File

@@ -15,6 +15,9 @@
"PUT",
"PATCH",
"DELETE"
],
"CorsHandler:_options_exposedHeaders": [
"Updates-Via"
]
},
{

View File

@@ -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<void> => {
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<string>();