You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewIOException("InputStream provided " + offset + ", but " + bodyLength + " were expected");
In my case I'm not the owner of the server, I can't fix this flaw. So even though the server is technically incorrect, I still want to be able to handle it.
A possible solution would be to add a flag to indicate that I want to either consume Content-Length amount or less. If it is less than Content-Length then I want to pull as much as possible without crashing.
The text was updated successfully, but these errors were encountered:
kwrooijen
changed the title
Server doesn't send enough data, RawHTTP crashes
Server response body doesn't match Content-Length, RawHTTP crashes
Dec 12, 2022
When the server does that, it's completely impossible to tell whether the server just gave the wrong value for the header, or if it crashed and failed to send the full response.
I can add an option to treat an incomplete body as "expected" but that feels very unreliable.
Currently when a response returns less data than specified in
Content-Length
, RawHTTP will crashrawhttp/rawhttp-core/src/main/java/rawhttp/core/body/BodyConsumer.java
Lines 158 to 159 in d51e4ce
In my case I'm not the owner of the server, I can't fix this flaw. So even though the server is technically incorrect, I still want to be able to handle it.
A possible solution would be to add a flag to indicate that I want to either consume
Content-Length
amount or less. If it is less thanContent-Length
then I want to pull as much as possible without crashing.The text was updated successfully, but these errors were encountered: