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

Response header Vary since Spring Security 6.2.0 #15378

Open
renetrefft opened this issue Jul 8, 2024 · 4 comments · May be fixed by #15444
Open

Response header Vary since Spring Security 6.2.0 #15378

renetrefft opened this issue Jul 8, 2024 · 4 comments · May be fixed by #15444
Assignees
Labels
in: web An issue in web modules (web, webmvc) type: bug A general bug
Milestone

Comments

@renetrefft
Copy link

renetrefft commented Jul 8, 2024

After upgrading from Spring Boot 3.1.* to Spring Boot 3.2.0 which includes Spring Security 6.2.0, responses of REST services provided by @Controller classes have Vary headers if org.springframework.boot:spring-boot-starter-security is in classpath.

Is this intended? We immediately noticed this change since our CDN Akamai does not cache responses with this header.

@renetrefft renetrefft added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Jul 8, 2024
@malaquf
Copy link

malaquf commented Jul 18, 2024

Hi @renetrefft , we also noticed this issue and I believe this is the commit that introduces it. Now CorsFilter is configured by default if CorsConfigurationSource is present.

@malaquf
Copy link

malaquf commented Jul 18, 2024

I believe this side effect is not intended, as HandlerMappingIntrospector implements CorsConfigurationSource and is instantiated by default by WebMvcConfigurationSupport in spring boot auto configure.

@jzheaux jzheaux added in: web An issue in web modules (web, webmvc) and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 18, 2024
@jzheaux
Copy link
Contributor

jzheaux commented Jul 18, 2024

I agree that this is likely not the intent. It may be best for Spring Security to be more conservative for the time being and pick up only UrlBasedCorsConfigurationSource instances.

@jzheaux jzheaux added this to the 6.2.6 milestone Jul 18, 2024
@baezzys
Copy link
Contributor

baezzys commented Jul 19, 2024

Hi @jzheaux I'd like to contribute to this issue. Can I work on it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) type: bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants