ResponseEntity's headers(HttpHeaders) accepts null value

Issue: SPR-12792
This commit is contained in:
Juergen Hoeller
2015-03-10 15:11:58 +01:00
parent 5ba7b89e29
commit 73e8021e59
2 changed files with 32 additions and 2 deletions

View File

@@ -381,7 +381,9 @@ public class ResponseEntity<T> extends HttpEntity<T> {
@Override
public BodyBuilder headers(HttpHeaders headers) {
this.headers.putAll(headers);
if (headers != null) {
this.headers.putAll(headers);
}
return this;
}