Skip to content

Commit

Permalink
refactor: remove corsAllowCredentials from default options
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Aug 2, 2022
1 parent 5e3e3d8 commit 26a9567
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/ServerlessOffline.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,8 @@ export default class ServerlessOffline {
.replace(/\s/g, '')
.split(',')

if (this.#options.corsDisallowCredentials) {
this.#options.corsAllowCredentials = false
}

this.#options.corsConfig = {
credentials: this.#options.corsAllowCredentials,
credentials: !this.#options.corsDisallowCredentials,
exposedHeaders: this.#options.corsExposedHeaders,
headers: this.#options.corsAllowHeaders,
origin: this.#options.corsAllowOrigin,
Expand Down
2 changes: 1 addition & 1 deletion src/config/defaultOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { createApiKey } from '../utils/index.js'

export default {
apiKey: createApiKey(),
corsAllowCredentials: true, // TODO no CLI option
corsAllowHeaders: 'accept,content-type,x-api-key,authorization',
corsAllowOrigin: '*',
corsDisallowCredentials: true,
corsExposedHeaders: 'WWW-Authenticate,Server-Authorization',
disableCookieValidation: false,
disableScheduledEvents: false,
Expand Down

0 comments on commit 26a9567

Please sign in to comment.