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

No way to disable caching of CORS-preflight responses #120

Open
jub0bs opened this issue Sep 1, 2023 · 0 comments
Open

No way to disable caching of CORS-preflight responses #120

jub0bs opened this issue Sep 1, 2023 · 0 comments

Comments

@jub0bs
Copy link

jub0bs commented Sep 1, 2023

Omitting the Access-Control-Max-Age header from a preflight response leads browsers to cache that response for 5 seconds, whereas including

Access-Control-Max-Age: 0

in a preflight response instructs browsers not to cache that preflight response. However, Gin's CORS middleware ignores that distinction and takes a MaxAge value of 0 as a cue to omit the Access-Control-Max-Age header. Therefore, Gin's CORS middleware prevents its users from disabling caching of preflight responses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant