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

feat(router): allow users to have multiple wildcards cores allow_origins #1358

Conversation

df-wg
Copy link
Contributor

@df-wg df-wg commented Nov 10, 2024

Motivation and Context

A previous effort, #880, gave the initial steps to enabling multiple wildcards in cors.allow_origins. This PR takes it further, ensuring that we can handle a config with the configuration:

name: "CORS_ALLOW_ORIGINS"
value: "https://*.example.com,https://example.com,https://*.example.io:*,https://*.example.org,https://*.mytest.amplifyapp.com"

Closes #879

Checklist

router/pkg/cors/cors.go Show resolved Hide resolved
@df-wg df-wg force-pushed the dave/eng-5826-support-multiple-wildcards-in-allow-_origins-cors-config branch from 28cc44b to 53cf22e Compare November 11, 2024 17:44
@df-wg
Copy link
Contributor Author

df-wg commented Nov 11, 2024

Bench with wildcard:
Screenshot 2024-11-11 at 7 42 56 PM

Bench without wildcard:
Screenshot 2024-11-11 at 7 43 44 PM

@df-wg df-wg force-pushed the dave/eng-5826-support-multiple-wildcards-in-allow-_origins-cors-config branch from 573ae6a to 23cab73 Compare November 12, 2024 09:42
Copy link
Contributor

@StarpTech StarpTech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@StarpTech StarpTech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@df-wg df-wg merged commit 8735f50 into main Nov 12, 2024
9 checks passed
@df-wg df-wg deleted the dave/eng-5826-support-multiple-wildcards-in-allow-_origins-cors-config branch November 12, 2024 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cors AllowWildcard never set - Wildcard origins not taken into account
3 participants