-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Support cases where the request is done with transfer-encoding chunked #589
Conversation
Looking at the CI failure it seems unrelated? |
@jacksontj, yep. I fixed the CI just now. Could you rebase please? |
@achew22 rebased |
This looks like a reasonable way to approach it. Do you think you could add some tests to that would have failed in the old system that pass in the new one? |
Added a test case for it, and rebased again (someone changed the template file ;) ) |
@achew22 test added, CI is passing |
@achew22 ping (in case the last one got lost in the inbox :) ) |
I'm terribly sorry, would you be willing to rebase this change to master? I made some significant changes to the Travis CI config I want to make sure this passes with them. |
PR grpc-ecosystem#527 was put in place to fix an issue where an empty request body would cause an empty message to be sent down to the GRPC service (instead of failing). The fix at the time was to check that the ContentLength was >0, but this doesn't take into consideration transfer-encoding chunked POSTs. Since this patch all chunked POSTs no longer unmarshal the message (as the content-length was 0). My proposed fix is instead to always call Decode and simply ignore EOF errors (as we still want to pass the un-filled struct down). I have tested that things such as partial json blobs (something like '{') don' t return EOF (they have their own json error).
It most definitely got lost in my inbox. Thanks so much for rebasing |
grpc-ecosystem#589) * Support cases where the request is done with transfer-encoding chunked PR grpc-ecosystem#527 was put in place to fix an issue where an empty request body would cause an empty message to be sent down to the GRPC service (instead of failing). The fix at the time was to check that the ContentLength was >0, but this doesn't take into consideration transfer-encoding chunked POSTs. Since this patch all chunked POSTs no longer unmarshal the message (as the content-length was 0). My proposed fix is instead to always call Decode and simply ignore EOF errors (as we still want to pass the un-filled struct down). I have tested that things such as partial json blobs (something like '{') don' t return EOF (they have their own json error).
PR #527 was put in place to fix an issue where an empty request body
would cause an empty message to be sent down to the GRPC service
(instead of failing). The fix at the time was to check that the
ContentLength was >0, but this doesn't take into consideration
transfer-encoding chunked POSTs. Since this patch all chunked POSTs
no longer unmarshal the message (as the content-length was 0).
My proposed fix is instead to always call Decode and simply ignore EOF
errors (as we still want to pass the un-filled struct down). I have
tested that things such as partial json blobs (something like '{') don'
t return EOF (they have their own json error).