fix: Expose Link via CORS.

This commit is contained in:
Ruben Verborgh 2021-07-28 15:37:35 +02:00
parent 0271536313
commit 643ceced36
2 changed files with 7 additions and 0 deletions

View File

@ -17,6 +17,7 @@
"options_credentials": true,
"options_exposedHeaders": [
"Accept-Patch",
"Link",
"Location",
"MS-Author-Via",
"Updates-Via",

View File

@ -99,6 +99,12 @@ describe('An http server with middleware', (): void => {
expect(exposed.split(/\s*,\s*/u)).toContain('Accept-Patch');
});
it('exposes the Link header via CORS.', async(): Promise<void> => {
const res = await request(server).get('/').expect(200);
const exposed = res.header['access-control-expose-headers'];
expect(exposed.split(/\s*,\s*/u)).toContain('Link');
});
it('exposes the Location header via CORS.', async(): Promise<void> => {
const res = await request(server).get('/').expect(200);
const exposed = res.header['access-control-expose-headers'];