Skip to content

Commit

Permalink
fix: Expose WAC-Allow via CORS.
Browse files Browse the repository at this point in the history
Closes #873
  • Loading branch information
RubenVerborgh committed Jul 28, 2021
1 parent a926839 commit 0271536
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config/http/middleware/handlers/cors.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"Accept-Patch",
"Location",
"MS-Author-Via",
"Updates-Via"
"Updates-Via",
"WAC-Allow"
]
}
]
Expand Down
6 changes: 6 additions & 0 deletions test/integration/Middleware.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ describe('An http server with middleware', (): void => {
expect(exposed.split(/\s*,\s*/u)).toContain('MS-Author-Via');
});

it('exposes the WAC-Allow 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('WAC-Allow');
});

it('exposes the Updates-Via header via CORS.', async(): Promise<void> => {
const res = await request(server).get('/').expect(200);
const exposed = res.header['access-control-expose-headers'];
Expand Down

0 comments on commit 0271536

Please sign in to comment.