Skip to content

CORS headers missing #2189

Answered by wolfgangwalther
leonixyz asked this question in Q&A
Discussion options

You must be logged in to vote

The CORS headers are set on a preflight request, not on the regular request. What you are showing is the output of the regular request.

You can see the CORS headers in the following request:

curl -H "Origin: http://example.com" \
  -H "Access-Control-Request-Method: POST" \
  -X OPTIONS --verbose \
  http://localhost:3000

*   Trying 127.0.0.1:3000...
* Connected to localhost (127.0.0.1) port 3000 (#0)
> OPTIONS / HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/7.82.0
> Accept: */*
> Origin: http://example.com
> Access-Control-Request-Method: POST
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Transfer-Encoding: chunked
< Date: Tue, 08 Mar 2022 07:57:06 GMT
< Server: po…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by wolfgangwalther
Comment options

You must be logged in to vote
1 reply
@wolfgangwalther
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #2184 on March 10, 2022 11:50.