© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•14mo ago•
15 replies
kopale.

Azure Static Web App (Blazor) problem with CORS

Hello, I have been developing a blazor wasm app that uses multi threading. The problem is that I don't know how can i set these headers
Cross-Origin-Embedder-Policy:require-corp
Cross-Origin-Embedder-Policy:require-corp
&
Cross-Origin-Opener-Policy:same-origin
Cross-Origin-Opener-Policy:same-origin
.

I tried to set them like the docs suggested in
staticwebapp.config.json
staticwebapp.config.json
like:
{
  "globalHeaders": {
    "Cross-Origin-Embedder-Policy": "require-corp",
    "Cross-Origin-Opener-Policy": "same-origin"
  }
}
{
  "globalHeaders": {
    "Cross-Origin-Embedder-Policy": "require-corp",
    "Cross-Origin-Opener-Policy": "same-origin"
  }
}

Still the headers are not set, but the workflow run passes anyway.

In local using dotnet serve it works that way:
dotnet serve -h "Cross-Origin-Opener-Policy:same-origin" -h "Cross-Origin-Embedder-Policy:require-corp" --directory bin\Release\net9.0\publish\wwwroot
dotnet serve -h "Cross-Origin-Opener-Policy:same-origin" -h "Cross-Origin-Embedder-Policy:require-corp" --directory bin\Release\net9.0\publish\wwwroot


What am I doing wrong? Can somebody please give me a working
staticwebapp.config.json
staticwebapp.config.json
? Thank you 🙂

PS: The app is full client side, no api calls.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Blazor web assembly app
C#CC# / help
2y ago
✅ Azure Static Web App (SWA) and NextJs - Anyone tried it ?
C#CC# / help
2y ago