Consistent HttpMethod identity comparisons

This commit is contained in:
Juergen Hoeller
2018-02-18 22:01:22 +01:00
parent d1e9161ca6
commit 0de36d2883
17 changed files with 69 additions and 100 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -61,7 +61,6 @@ public class HttpHandlerConnector implements ClientHttpConnector {
private static Log logger = LogFactory.getLog(HttpHandlerConnector.class);
private final HttpHandler handler;
@@ -118,8 +117,7 @@ public class HttpHandlerConnector implements ClientHttpConnector {
}
private ServerHttpResponse prepareResponse(ServerHttpResponse response, ServerHttpRequest request) {
return HttpMethod.HEAD.equals(request.getMethod()) ?
new HttpHeadResponseDecorator(response) : response;
return (request.getMethod() == HttpMethod.HEAD ? new HttpHeadResponseDecorator(response) : response);
}
private ClientHttpResponse adaptResponse(MockServerHttpResponse response, Flux<DataBuffer> body) {