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

support Private Network Access #127

Merged
merged 1 commit into from Feb 23, 2022
Merged

Conversation

cvermilion
Copy link
Contributor

@cvermilion cvermilion commented Feb 22, 2022

Based on this Chrome blog and the related W3C draft report.

If the Options.AllowPrivateNetwork flag is set, and a preflight request includes Access-Control-Request-Private-Network, we include Access-Control-Allow-Private-Network in the response. The assumption here is that any origin that we allow CORS requests from is also allowed to access the server via a private network; if you want per-origin logic for this you probably want to write your own CORS handler.

Per my understanding of the spec, the header is only added for preflight (OPTIONS) requests.

@rs rs merged commit a4a5ce8 into rs:master Feb 23, 2022
@jub0bs
Copy link
Contributor

jub0bs commented Oct 1, 2022

One omission of this PR is the addition of Access-Control-Request-Private-Network to the Vary header, to be consistent with the rest under the assumption that preflight responses be cached by some Web cache.

cvermilion added a commit to remixlabs/cors that referenced this pull request Oct 3, 2022
@cvermilion
Copy link
Contributor Author

@jub0bs, good catch!. Here's a followup PR: #132.

@cvermilion cvermilion deleted the private-network-access branch October 3, 2022 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants