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

[BUG] CORS middleware sets Vary: Origin header only in some cases #244

Open
1 task done
toaster opened this issue Aug 24, 2023 · 1 comment
Open
1 task done

[BUG] CORS middleware sets Vary: Origin header only in some cases #244

toaster opened this issue Aug 24, 2023 · 1 comment
Labels

Comments

@toaster
Copy link

toaster commented Aug 24, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When using the CORS handler with an AllowedOriginValidator, the Vary header is not set to Origin.

Expected Behavior

The header (Vary: Origin) should always be set when a validator function is present because the middleware cannot predict the outcome of the function and whether it might change for different input.

@jub0bs
Copy link

jub0bs commented Sep 1, 2023

Recommended reading about why CORS libraries should not support custom callbacks like AllowedOriginValidator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

2 participants