HttpEntity.EMPTY should be immutable
See gh-34812 Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
This commit is contained in:
committed by
rstoyanchev
parent
5013d6d771
commit
d7c13d6518
@@ -49,6 +49,7 @@ import org.springframework.util.ObjectUtils;
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @author Juergen Hoeller
|
||||
* @author Yanming Zhou
|
||||
* @since 3.0.2
|
||||
* @param <T> the body type
|
||||
* @see org.springframework.web.client.RestTemplate
|
||||
@@ -60,7 +61,7 @@ public class HttpEntity<T> {
|
||||
/**
|
||||
* The empty {@code HttpEntity}, with no body or headers.
|
||||
*/
|
||||
public static final HttpEntity<?> EMPTY = new HttpEntity<>();
|
||||
public static final HttpEntity<?> EMPTY = new HttpEntity<>(HttpHeaders.EMPTY);
|
||||
|
||||
|
||||
private final HttpHeaders headers;
|
||||
|
||||
Reference in New Issue
Block a user