-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
fix http output to never have both transfer-encoding and content-length #1776
Conversation
' | ||
|
||
test_expect_success "Only one of Transfer-Encoding or Content-Length exists" ' | ||
! [ `cat has_te` -ne 0 -a `cat has_cl` -ne 0 ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can probably use
! [ `test -f has_te` -a `test -f has_cl` ]
It was breaking a non-conforming http client I was using, not breaking anything anymore. I'd be happy to leave as is, since any conformant http client should be ignoring content-length when a non-identity transfer-encoding is also present. |
@diasdavid saw something weird today. on https://ipfs.io homepage:
but then it stopped. may be worth merging to avoid this. though i wonder what this was..... how would the length vary? |
We had decided in another PR that we should set the header |
We should also always return correct length-- have seen it off sometimes On Thursday, October 8, 2015, Jeromy Johnson notifications@github.com
|
@wemeetagain @jbenet update here? |
Not sure about the incorrect content length being sent, but I'll shortly update the PR to return the |
36a332d
to
47704af
Compare
RFC2616 states that one must not have both transfer-encoding and content-length. This patch changes the Content-Length header to X-Content-Length to avoid the conflict. License: MIT Signed-off-by: Cayman Nava <caymannava@gmail.com>
47704af
to
29f086b
Compare
updated~, OP edited to reflect changes. |
maybe this is a good way to avoid breaking things if the thing is incorrect header. before merging, feedback @mappum @diasdavid ? |
It has been a long time since I saw that error. Setting up Content-Length LGTM as it is the standardised header for that purpose |
@diasdavid this is not using |
I think switching to |
LGTM |
I believe this has been resolved in a different PR, i no longer see both content length and chunked encoding together. If it is still an issue please reopen this PR, or file an issue with repro steps |
Fixes #1765
Since our http responses are unconditionally sending a non-identity
Transfer-Encoding
header, we shouldn't send aContent-Length
Header.This patch changes the output
Content-Length
toX-Content-Length
to resolve that issue and adds a test to confirm thatTransfer-Encoding
andContent-Length
are not both specified.