-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Automatically enable .cors() if CorsConfigurationSource bean is present #5011
Comments
IMHO enabling CORS isn't the right default for Spring Security, considering the other defaults currently set (CSRF, PasswordEncoders, etc.) Although CORS isn't entirely analogous to those other features, it still feels like it would be going against the grain, even if the allowed origin & methods are restricted. |
This is really about if a user provides a |
This is done by Spring Security since the beginning, or I am missing something, see Lines 87 to 91 in 5db3e54
In other words, if you do In addition to that, we do not want to configure CORS by default if the I'll close this as invalid since this is already working as requested, but if I missed something we can reopen and continue the discussion. |
Thanks to @jzheaux I realized that my previous comment was not giving a good argument not to do this. Instead, we should avoid boilerplate code by not requiring Josh's words were pretty convincing: "If an application does not have Spring Security and is using |
This would avoid Boot needing to add that to provide support for CORS out of the box.
The text was updated successfully, but these errors were encountered: