Skip to content
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

HTTP API - cat output has both Content-Length and Transfer-Encoding #1765

Closed
wemeetagain opened this issue Sep 29, 2015 · 3 comments
Closed
Labels
kind/bug A bug in existing code (including security flaws) topic/gateway Topic gateway

Comments

@wemeetagain
Copy link
Member

From RFC2616#4.4:

Messages MUST NOT include both a Content-Length header field and a non-identity transfer-coding.

The cat http response message includes both a content-length header field and a non-identity transfer-encoding.

proof:

$ echo 'test' > test.txt
$ ipfs add test.txt 
added QmeomffUNfmQy76CQGy9NdmqEnnHU9soCexBnGU3ezPHVH test.txt
$ curl -i http://localhost:5001/api/v0/cat?arg=QmeomffUNfmQy76CQGy9NdmqEnnHU9soCexBnGU3ezPHVH                                            
HTTP/1.1 200 OK
Content-Length: 5
Transfer-Encoding: chunked
X-Stream-Output: 1

test

for comparison, the block get output:

$ curl -i http://localhost:5001/api/v0/block/get?arg=QmeomffUNfmQy76CQGy9NdmqEnnHU9soCexBnGU3ezPHVH                                       
HTTP/1.1 200 OK
Transfer-Encoding: chunked
X-Stream-Output: 1



test
@jbenet
Copy link
Member

jbenet commented Sep 29, 2015

SGTM. let's

  • add a sharness test.
  • fix the bug.

@whyrusleeping whyrusleeping added kind/bug A bug in existing code (including security flaws) topic/gateway Topic gateway labels Oct 11, 2015
@rht
Copy link
Contributor

rht commented Jan 21, 2016

Fixed in #2229 and test included.

@whyrusleeping
Copy link
Member

fixed in #2465

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) topic/gateway Topic gateway
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants