ipfs/kubo

NDJSON API endpoins should use application/x-ndjson Content-Type header

Open

#3,737 创建于 2017年3月1日

在 GitHub 查看
 (19 评论) (1 反应) (0 负责人)Go (13,906 star) (2,725 fork)batch import
help wantedkind/bugtopic/apitopic/rpc-api

描述

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

贡献者指南

NDJSON API endpoins should use application/x-ndjson Content-Type header · ipfs/kubo#3737 | Good First Issue