-
Notifications
You must be signed in to change notification settings - Fork 59
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
Support Private Network CORS #277
Comments
Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests. |
Hi @danjenkins I was thinking of working on this. I'm wondering do we need to do this part as well, if I fix the CORS thing. Also that is the error without fixing the CORS thing.
|
@Rai-Sahil do you mean what is the error? The error is that the request fails because the browser doesn't get given the right headers in the response. To do it properly we need to check if the request has the header If you'd like to take this on and make a PR feel free :) Don't forget about the unit tests though. If not I can do a PR with unit tests. |
@danjenkins Thanks, I'll start working on it. I'll comment here if I have any further questions |
I'm -1 on this for the time being until all major browsers support this, not just Chromium. Thanks for raising it though! Firefox's support for this is in prototype stage, and WebKit's position on this is tentative. |
@Fdawgs yeah, I'm in two minds but it's causing problems with things running in chrome canary and I'm pretty certain it will be causing problems in other versions of chrome too... hence why I wrote the patch :) I'm good waiting to see how it all pans out and to carry on using my patch file for now... 🤷♂️ |
I would treats it the same as fastify/fastify-cookie#261 In order to get the PR accepted,
|
I think fastify/fastify-cookie#261 is a bit different though in that the other browsers are supportive of the change but have yet to implement it. With this, the responses seem a bit "meh". |
Prerequisites
🚀 Feature Proposal
There are changes coming to how we access private networks (localhost for example) from non localhost https websites. https://developer.chrome.com/blog/private-network-access-update/#cors-preflight-requests explains about all the changes plus the changes to CORS.
Basically needing to add
[Access-Control-Request-Private-Network](https://wicg.github.io/private-network-access/#http-headerdef-access-control-request-private-network): true
to the headers.I've attached an example of what I've added as a patch to
@fastify/cors
which will need some extra work if these changes are accepted... like only setting the response if theAccess-Control-Request-Private-Network: true
header is in the request.But before I did the extra work I wanted to see if this was useful/interesting.
Motivation
No response
Example
The text was updated successfully, but these errors were encountered: