-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Cache-control headers within the controller are ignored with spring security #8949
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
Comments
@czubin This seems to be happening because of this change in Spring Security. spring-projects/spring-security@57d7ad0. Previously, as can be seen in this commit, spring-projects/spring-security@242b831, Spring Security would only write the Cache-Control header if it was not set. @philwebb This doesn't seem like a Boot issue, but more like something for Spring Security or Spring MVC. WDYT? |
I think this should have been fixed by spring-projects/spring-security@168f4b8 which is in Spring Security 4.2.2 (the default version in Boot 1.5.2). @czubin What version of Spring Security are you using? |
@wilkinsona We are currently using the latest(1.5.2). It seems to me that previously the headers were written after completion of the filterchain. Which caused problems with users who flushed the response. I'm going to use a workaround as specified in spring-projects/spring-security#2953 |
We think this duplicates spring-projects/spring-security#4199 so I'll close the issue for now. If you can create a sample that reproduces it with Spring Security 4.2.2 and Boot 1.5.3 please attach it and we'll re-open. (edited with correct issue link) |
@philwebb Okay, I'll make an issue with spring-security project. 1.5.3 has the same regression. |
@czubin Thanks, can you paste a link to the issue that you create here so that we have a future breadcrumb trail. |
Made a new ticket spring-projects/spring-security#4307 |
Bug report:
Since spring boot 1.5 the 'Cache-control' headers can no longer be set within a controller.
Using ResponseEntity.cacheControl().
The test and code below works under spring boot 1.4.5.
Security configuration:
Controller:
Test:
The text was updated successfully, but these errors were encountered: