Consistent handling of null header values in HttpHeaders
Issue: SPR-17588
This commit is contained in:
@@ -177,10 +177,7 @@ class DefaultServerResponseBuilder implements ServerResponse.BodyBuilder {
|
||||
|
||||
@Override
|
||||
public ServerResponse.BodyBuilder cacheControl(CacheControl cacheControl) {
|
||||
String ccValue = cacheControl.getHeaderValue();
|
||||
if (ccValue != null) {
|
||||
this.headers.setCacheControl(cacheControl.getHeaderValue());
|
||||
}
|
||||
this.headers.setCacheControl(cacheControl);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -345,11 +345,9 @@ public class ResourceWebHandler implements WebHandler, InitializingBean {
|
||||
}
|
||||
|
||||
// Apply cache settings, if any
|
||||
if (getCacheControl() != null) {
|
||||
String value = getCacheControl().getHeaderValue();
|
||||
if (value != null) {
|
||||
exchange.getResponse().getHeaders().setCacheControl(value);
|
||||
}
|
||||
CacheControl cacheControl = getCacheControl();
|
||||
if (cacheControl != null) {
|
||||
exchange.getResponse().getHeaders().setCacheControl(cacheControl);
|
||||
}
|
||||
|
||||
// Check the media type for the resource
|
||||
|
||||
Reference in New Issue
Block a user