Skip to content

Commit

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

0 comments on commit 52b9017

Please sign in to comment.