Skip to content
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

Access-Control-Allow-Methods should be GET,HEAD #1383

Merged
merged 1 commit into from May 10, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Access-Control-Allow-Methods are GET,HEAD

Fixes: #1267
  • Loading branch information
feross committed May 10, 2018
commit 8c8613d6bcb2a48a7aa996ffb08d379c3e20bea0
@@ -111,7 +111,7 @@ function Server (torrent, opts) {
function serveOptionsRequest () {
res.statusCode = 204 // no content
res.setHeader('Access-Control-Max-Age', '600')
res.setHeader('Access-Control-Allow-Methods', 'GET,HEAD,PUT,PATCH,POST,DELETE')
res.setHeader('Access-Control-Allow-Methods', 'GET,HEAD')

This comment has been minimized.

Copy link
@diracdeltas

diracdeltas May 10, 2018

Contributor

lgtm - do you actually need HEAD though?

This comment has been minimized.

Copy link
@feross

feross May 10, 2018

Author Member

We do currently support HEAD, so it needs to stay in this header if we want it to keep working. You can see how we handle it here:

return res.end()

I don't think it hurts to keep it.


if (req.headers['access-control-request-headers']) {
res.setHeader(
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.