-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(index): change default methods
to cors-safelisted methods
#359
base: main
Are you sure you want to change the base?
Conversation
index.js
Outdated
@@ -8,7 +8,7 @@ const { | |||
|
|||
const defaultOptions = { | |||
origin: '*', | |||
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE', | |||
methods: 'GET,HEAD,PUT', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From your reference, it should be GET, HEAD and POST. Instead of PUT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, thanks @climba03003, fixed in 32c895b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but please wait for one more approval before merging.
@@ -63,7 +63,7 @@ You can use it as is without passing any option or you can configure it as expla | |||
cb(new Error("Not allowed"), false) | |||
} | |||
``` | |||
* `methods`: Configures the **Access-Control-Allow-Methods** CORS header. Expects a comma-delimited string (e.g., 'GET,PUT,POST') or an array (e.g., `['GET', 'PUT', 'POST']`). Default: `GET,HEAD,PUT,PATCH,POST,DELETE`. | |||
* `methods`: Configures the **Access-Control-Allow-Methods** CORS header. Expects a comma-delimited string (e.g., 'GET,PUT,POST') or an array (e.g., `['GET', 'PUT', 'POST']`). Default: `GET,HEAD,PUT`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we add some explanations and a link to the specification?
Closes #358.
This is a breaking change and will require a semver major release.
Checklist
npm run test
andnpm run benchmark
and the Code of conduct