Skip to content

Commit

Permalink
[fix][HTTP2] content-length is not set properly when method is HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
funa-tk committed Jan 15, 2020
1 parent 7124ff3 commit 4c9d3a1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private void encodeFromHttp(HpackEncoder encoder, boolean originalHttpHeader) th
MetaData meta;
if (http.isRequest()) {
long contentLength = 0;
if (method.equals("GET")) {
if (method.equals("GET") || method.equals("HEAD")) {
contentLength = (http.getBody().length == 0 ? Long.MIN_VALUE : http.getBody().length);
} else if (method.equals("POST") || method.equals("PUT")) {
contentLength = http.getBody().length;
Expand Down

0 comments on commit 4c9d3a1

Please sign in to comment.