Merge branch '5.1.x'
This commit is contained in:
@@ -874,7 +874,7 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
|
||||
/**
|
||||
* Set the {@link Locale} of the content language,
|
||||
* as specified by the {@literal Content-Language} header.
|
||||
* <p>Use {@code set(CONTENT_LANGUAGE, ...)} if you need
|
||||
* <p>Use {@code set(CONTENT_LANGUAGE, list)} if you need
|
||||
* to set multiple content languages.</p>
|
||||
* @since 5.0
|
||||
*/
|
||||
|
||||
@@ -119,7 +119,8 @@ public class EncoderHttpMessageWriter<T> implements HttpMessageWriter<T> {
|
||||
|
||||
if (inputStream instanceof Mono) {
|
||||
HttpHeaders headers = message.getHeaders();
|
||||
return Mono.from(body)
|
||||
return body
|
||||
.singleOrEmpty()
|
||||
.switchIfEmpty(Mono.defer(() -> {
|
||||
headers.setContentLength(0);
|
||||
return message.setComplete().then(Mono.empty());
|
||||
|
||||
Reference in New Issue
Block a user