Skip to content

Commit 43415de

Browse files
committed
HTTPResponseProcessor: Fix for chunked encoding with HEAD
1 parent 3dc5e5f commit 43415de

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

protocol/src/main/java/org/threadly/litesockets/protocols/http/response/HTTPResponseProcessor.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,9 @@ public void processData(MergedByteBuffers bb) {
106106
}
107107
response = new HTTPResponse(hrh, hh);
108108
listeners.call().headersFinished(response);
109-
if(!response.getHeaders().isChunked() &&
110-
response.getResponseCode() != HTTPResponseCode.SwitchingProtocols &&
109+
if(response.getResponseCode() != HTTPResponseCode.SwitchingProtocols &&
111110
(headRequest || response.getResponseCode() == HTTPResponseCode.NoContent ||
112-
response.getHeaders().getContentLength() == 0)) {
111+
(!response.getHeaders().isChunked() && response.getHeaders().getContentLength() == 0))) {
113112
reset(null);
114113
}
115114
} catch(Exception e) {

0 commit comments

Comments
 (0)