See gh-24238
This commit is contained in:
Brian Clozel
2020-01-07 09:05:49 +01:00
parent ea6d2ea1ce
commit ffc1f960f9
4 changed files with 25 additions and 29 deletions

View File

@@ -29,7 +29,6 @@ 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;
@@ -210,9 +209,7 @@ 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()) {
HttpHeaders.clearContentHeaders(exchange.getResponse().getHeaders());
}
exchange.getResponse().getHeaders().clearContentHeaders();
InvocableHandlerMethod invocable = this.methodResolver.getExceptionHandlerMethod(exception, handlerMethod);
if (invocable != null) {