-
Notifications
You must be signed in to change notification settings - Fork 125
If not given a content-length, .stream should assume transfer-encoding:chunked #218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@weissi do you think we need to prepend length to bytes we get from the client? Or just assume that the client did that? |
I don’t quite understand the question. What do you want to prepend? |
@weissi length of the chunk being written, followed by |
@artemredkin that is the HTTP wire protocol. And neither AHC nor the user should think about it. NIO does the HTTP wire protocol (incl chunked encoding) for you. If yoy were to prepend anything in AHC then that would go into the data stream so it would become corrupted. From AHC’s perspective, you don’t need to worry about chunked or not. You can select it by:
|
@artemredkin a few things that AHC does need to do are:
|
Ok, got it, thanks! I’ll address body checking when I get to #251 |
Motivation: Streams length parameter is optional to allow cases were stream length is not known in advance, but we do not support this in request validation. This PR aims to address that. Modifications: Modifies request validation to default to chunked encoding if body length is zero or to passed in content-length header Adds a test Result: Closes #218
[THIS SHOULD BE FIXED AFTER #217]
this
Request
will actually error (sort of, see #217) but it should just assumetransfer-encoding: chunked
, the user clearly hasn't given a content length.If the user manually set a
content-length
inheaders:
, then we should obvs use that.The text was updated successfully, but these errors were encountered: