ipfs/kubo
View on GitHubNDJSON API endpoins should use application/x-ndjson Content-Type header
Open
#3737 opened on Mar 1, 2017
help wantedkind/bugtopic/apitopic/rpc-api
Description
Version information:
go-ipfs version: 0.4.5-
Repo version: 5
System version: amd64/darwin
Golang version: go1.7.4
Type: Bug
Priority: P2
Description:
Compare:
curl -D - "http://localhost:5001/api/v0/log/tail"
HTTP/1.1 200 OK
Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length
Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length
Content-Type: text/plain
Server: go-ipfs/0.4.5
Trailer: X-Stream-Error
Vary: Origin
X-Stream-Output: 1
Date: Wed, 01 Mar 2017 10:14:45 GMT
Transfer-Encoding: chunked
curl -D - "http://localhost:5001/api/v0/pubsub/sub?arg=<topic>&discover=false"
HTTP/1.1 200 OK
Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length
Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length
Content-Type: application/json
Server: go-ipfs/0.4.5
Trailer: X-Stream-Error
Vary: Origin
X-Chunked-Output: 1
Date: Wed, 01 Mar 2017 10:14:53 GMT
Transfer-Encoding: chunked
Not only they are different, they are both wrong as proper content type is application/x-ndjson.
Edited by Kubuxu