Merge branch '5.1.x'

This commit is contained in:
Brian Clozel
2019-02-21 17:52:17 +01:00
2 changed files with 8 additions and 4 deletions

View File

@@ -29,6 +29,7 @@ import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.ReactiveAdapterRegistry;
import org.springframework.http.HttpHeaders;
import org.springframework.http.codec.HttpMessageReader;
import org.springframework.http.codec.ServerCodecConfigurer;
import org.springframework.lang.Nullable;
@@ -209,6 +210,9 @@ public class RequestMappingHandlerAdapter implements HandlerAdapter, Application
// Success and error responses may use different content types
exchange.getAttributes().remove(HandlerMapping.PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE);
if (!exchange.getResponse().isCommitted()) {
exchange.getResponse().getHeaders().remove(HttpHeaders.CONTENT_TYPE);
}
InvocableHandlerMethod invocable = this.methodResolver.getExceptionHandlerMethod(exception, handlerMethod);
if (invocable != null) {