Add support for Private Network Access (CORS header Access-Control-Allow-Private-Network)
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
I am trying to reach my ASP.NET core api running on https://localhost:5001/ from a SPA which is hosted on another domain (although same computer for me) and I get a CORS error.
Describe the solution you’d like
I would like to propose that we extend the CorsPolicy
with the boolean property AllowPrivateNetworkAccess
and CorsPolicyBuilder
with the method WithPrivateNetworkAccess
which the CorsService
uses to set the Access-Control-Allow-Private-Network: true
on preflight requests if the browser sends the Access-Control-Request-Private-Network: true
header in the request.
Additional context
Link to WICG Draft: https://wicg.github.io/private-network-access/ Link to Chrome developer article about the feature and roll out: https://developer.chrome.com/blog/private-network-access-preflight/
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Private Network Access: introducing preflights
First, implement support for standard CORS preflight requests on affected routes. Then add support for the two new response headers. When your ...
Read more >IIS CORS Module support for Access-Control-Allow-Private ...
Chromium 98 introduces [1] a new CORS request. Is there a way to request support for additional CORS headers from the Official Microsoft...
Read more >Spring CORS Filter for Access-Control-Allow-Private ...
I am using Spring Boot 2.7 therefore Spring 5.3 is included. It uses a custom CorsProcessor class to add the relevant header to...
Read more >CORS extension “Private Network Access”
This works by issuing a HTTP OPTIONS request, adding information about the upcoming request with the headers Access-Control-Request-Method and ...
Read more >How to add the "Access-Control-Allow-Private-Network
The solution is to send a custom header from Wowza server Access-Control-Allow-Private-Network: true whenever the HTTP provider url is accessed.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For people who are having issues with the private network access cors header, you can add the following code snippet just before
app.UseCors()
in your ASP.NET application to work around the issue until we get proper support through theCorsPolicyBuilder
interface:Thanks for contacting us.
We’re moving this issue to the
.NET 8 Planning
milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s). If we later determine, that the issue has no community involvement, or it’s very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.