Skip to content

Commit

Permalink
Removed redundant isHead method
Browse files Browse the repository at this point in the history
  • Loading branch information
jekh committed Dec 18, 2016
1 parent 8ce850c commit 2f13621
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ void respond(ProxyToServerConnection serverConnection, HttpFilters filters,
// if this HttpResponse does not have any means of signaling the end of the message body other than closing
// the connection, convert the message to a "Transfer-Encoding: chunked" HTTP response. This avoids the need
// to close the client connection to indicate the end of the message. (Responses to HEAD requests "must be" empty.)
if (!ProxyUtils.isHead(currentHttpRequest) && !ProxyUtils.isResponseSelfTerminating(httpResponse)) {
if (!ProxyUtils.isHEAD(currentHttpRequest) && !ProxyUtils.isResponseSelfTerminating(httpResponse)) {
// if this is not a FullHttpResponse, duplicate the HttpResponse from the server before sending it to
// the client. this allows us to set the Transfer-Encoding to chunked without interfering with netty's
// handling of the response from the server. if we modify the original HttpResponse from the server,
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/org/littleshoot/proxy/impl/ProxyUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -386,16 +386,6 @@ public static boolean isContentAlwaysEmpty(HttpMessage msg) {
return false;
}

/**
* Returns true if the request is an HTTP HEAD request.
*
* @param request HTTP request
* @return true if request is a HEAD, otherwise false
*/
public static boolean isHead(HttpRequest request) {
return HttpMethod.HEAD.equals(request.getMethod());
}

/**
* Returns true if the HTTP response from the server is expected to indicate its own message length/end-of-message. Returns false
* if the server is expected to indicate the end of the HTTP entity by closing the connection.
Expand Down

0 comments on commit 2f13621

Please sign in to comment.