-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Write HTTP Headers Eagerly by Default #18840
Copy link
Copy link
Open
Labels
in: webAn issue in web modules (web, webmvc)An issue in web modules (web, webmvc)type: breaks-passivityA change that breaks passivity with the previous releaseA change that breaks passivity with the previous releasetype: enhancementA general enhancementA general enhancement
Metadata
Metadata
Assignees
Labels
in: webAn issue in web modules (web, webmvc)An issue in web modules (web, webmvc)type: breaks-passivityA change that breaks passivity with the previous releaseA change that breaks passivity with the previous releasetype: enhancementA general enhancementA general enhancement
Type
Fields
Give feedbackNo fields configured for issues without a type.
Previously, it was not ideal for Spring Security to proactively set HTTP Headers because setting a header meant there was no way for the user to remove a header.
This has changed in Servlet 6.1 where the Javadoc of
HttpServletResponse.setHeader(String, String)states:Users could always override the default headers with a new value. Since servlet 6.1, they can now remove the header.
Spring Security should be updated to set the headers eagerly by default. Users wishing to override headers can now do so.
This does break passivity because today applications that set or adds a single cache control header ensures that Spring Security sets no cache control headers.