Reset Pragma header in WebContentGenerator
As filter-based libraries and projects (such as Spring Security) may use the "Pragma" header in HTTP responses, WebContentGenerator should make sure that such headers are overwritten to avoid clashes with the HTTP caching headers set by the HTTP caching configuration. Issue: SPR-13252
This commit is contained in:
@@ -394,6 +394,9 @@ public abstract class WebContentGenerator extends WebApplicationObjectSupport {
|
||||
String ccValue = cacheControl.getHeaderValue();
|
||||
if (ccValue != null) {
|
||||
response.setHeader(HEADER_CACHE_CONTROL, ccValue);
|
||||
if (response.containsHeader(HEADER_PRAGMA)) {
|
||||
response.setHeader(HEADER_PRAGMA, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -430,6 +433,9 @@ public abstract class WebContentGenerator extends WebApplicationObjectSupport {
|
||||
}
|
||||
response.setHeader(HEADER_CACHE_CONTROL, headerValue);
|
||||
}
|
||||
if (response.containsHeader(HEADER_PRAGMA)) {
|
||||
response.setHeader(HEADER_PRAGMA, "");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user