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
Set transfer encoding for multipart/related to chunked by default #1276
Conversation
@triccardi-systran can you take a look at this as well? |
Why not? |
@nylen I think you are correct, at some point I didn't received anything, but I tested a few things along the way, will push. EDIT: saw that will change it 👍 |
@nylen all done, fixed my PR description as well. |
Here is the reason (in Node
It looks to me like this is a heuristic which we can override if we assume the user knows what they're doing and really wants to send a chunked GET. Note that it applies to different methods over time (GET, HEAD at first; then CONNECT, DELETE, and OPTIONS added later on). So, 👍 from me, but would like feedback from @triccardi-systran on whether this fixes his issue. |
Okay, this seems fine to me! Just one question: how do we guarantee that node.js http will not send in chunks anyway when we have chunked = false? |
If the Then here Having the |
Here's the relevant core code: lib/http.js#L630 @simov do we have a test to make sure there is only one of |
@nylen you refer to the the scenario where the user sets the |
Ah, it's in there. I was thinking of this: https://github.com/simov/request/blob/multipart-get/tests/test-multipart.js#L28 |
Thanks @triccardi-systran and @simov for your work on this! |
Set transfer encoding for multipart/related to chunked by default
@simov I tested this case, and since |
I don't think we can or should guard against every combination of impossible settings, this one in particular is obviously user error. |
This is not obviously a user error since the user doesn't know that multipart is chunked encoded by default (since it's a default). |
Fixes #1271
Also added a test for
GET
request.Basically the test for this feature is
Inside theend
event of the request there is no body whenGET
request is being used.