-
Notifications
You must be signed in to change notification settings - Fork 24.8k
CORS wildcard subdomain setup is incorrect #36192
Copy link
Copy link
Closed
Labels
Source - Docs.msDocs Customer feedback via GitHub IssueDocs Customer feedback via GitHub Issueaspnet-core/svcokr-healthContent health internal initiativeContent health internal initiativeseQUESTeredIdentifies that an issue has been imported into Quest.Identifies that an issue has been imported into Quest.security/subsvc
Metadata
Metadata
Labels
Source - Docs.msDocs Customer feedback via GitHub IssueDocs Customer feedback via GitHub Issueaspnet-core/svcokr-healthContent health internal initiativeContent health internal initiativeseQUESTeredIdentifies that an issue has been imported into Quest.Identifies that an issue has been imported into Quest.security/subsvc
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description
The CORS documentation regarding wildcard subdomains using
SetIsOriginAllowedToAllowWildcardSubdomainsincorrectly states that the wildcard character * should be omitted from the domains passed toWithOrigin(e.g."https://example.com"). Doing so causes no subdomains to be matched, and the CORS middleware does not include the required response header.When including * in the values passed to
WithOrigin(e.g."https://*.example.com"), subdomains are matched and the CORS middleware correctly includes the required response header.Page URL
https://learn.microsoft.com/en-us/aspnet/core/security/cors?view=aspnetcore-8.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/security/cors.md
Document ID
d3f332c4-4c60-039e-0e1e-bc6b11831f87
Platform Id
fa70aa3f-a2de-be8b-4255-e778a6edb8ff
Article author
@tdykstra
Metadata
Related Issues
Associated WorkItem - 537420