Skip to content

Commit

Permalink
fix: Allow credentials over CORS.
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenVerborgh committed Jan 4, 2021
1 parent bf61007 commit ee072b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/presets/middleware.json
Expand Up @@ -16,6 +16,7 @@
"PATCH",
"DELETE"
],
"CorsHandler:_options_credentials": true,
"CorsHandler:_options_exposedHeaders": [
"Location",
"Updates-Via"
Expand Down
1 change: 1 addition & 0 deletions test/integration/Middleware.test.ts
Expand Up @@ -44,6 +44,7 @@ describe('An Express server with middleware', (): void => {
it('returns CORS headers for an OPTIONS request.', async(): Promise<void> => {
const res = await request(server)
.options('/')
.set('Access-Control-Allow-Credentials', 'true')
.set('Access-Control-Request-Headers', 'content-type')
.set('Access-Control-Request-Method', 'POST')
.set('Host', 'test.com')
Expand Down

0 comments on commit ee072b0

Please sign in to comment.