CORS - AnyOrigin & WithOrigins has no effect
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
ConfigureServices:
services.AddCors(options =>
{
options.AddPolicy("CorsPolicy",
builder => builder
.WithOrigins("http://192.168.3.9:8080")
.AllowAnyMethod()
.AllowAnyHeader());
});
Configure:
app.UseRouting();
app.UseCors("CorsPolicy");
Result:
I also had the effect for a short time although it didn't work before, but then it suddenly worked.
I deleted the bin and obj folders and recompiled them..no effect
### Expected Behavior
That it works.
### Steps To Reproduce
- Create an separated api and blazor wasm client in .net 9
- Create an endpoint and connect to this on client side
### Exceptions (if any)
_No response_
### .NET Version
.net 9
### Anything else?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.