Skip to content

Latest commit

 

History

History
22 lines (14 loc) · 621 Bytes

README.md

File metadata and controls

22 lines (14 loc) · 621 Bytes

NextJS Rewrites Break CORS

Link to Issue on NextJS

Problem

When using rewrites, we expect endpoints to be able to handle CORS, but nextjs does custom CORS handling

Reproduction

  1. Run yarn run next dev inside this repo
  2. Run the curl command below:
curl -v 'http://localhost:3000/api' \                                       
  -X 'OPTIONS' \
  -H 'Origin: http://localhost:3000'
  1. Look at server logs. If the endpoint was executed, you would have seen nextjs will never log this line with OPTIONS and an Origin header in the server console