cyu / rack-cors

Rack Middleware for handling Cross-Origin Resource Sharing (CORS), which makes cross-origin AJAX possible.
MIT License
3.26k stars 263 forks source link

How to add Access-Control-Allow-Private-Network header in Option response? #263

Closed galexw closed 1 year ago

galexw commented 1 year ago

I am working on a project that has a public network accessing my local environment via ngrok.

This causes the warning shown below in Chrome when the browser makes a preflight OPTION request.

Screen Shot 2023-04-16 at 10 33 30 PM

It seems like I would have to add the header Access-Control-Allow-Private-Network. Is there a way to customize the headers returned?

Link in the warning message: https://developer.chrome.com/blog/private-network-access-update/?utm_source=devtools