filecoin-project / filecoin-project/go-jsonrpc

RPC call returns wrong content-type

Open
#43 2 comments 1 reaction 0 assignees View on GitHub
bug good first issue
Dominant language
Go
Stars
100
Forks
95
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
RPC call returns wrong Content-Type header in response

**To Reproduce**
Steps to reproduce the behavior:
1. Run curl -v -X POST 'http://lotus:1234/rpc/v0' -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"jsonrpc": "2.0","method": "Filecoin.WalletBalance",
"params": ["t1jdlfl73voaiblrvn2yfivvn5ifucwwv5f26nfza"],"id": 0}'
2. See in response "Content-Type: text/plain; charset=utf-8"

**Expected behavior**
Content-Type: application/json; charset=utf-8

**Screenshots**

curl -v -X POST 'http://lotus:1234/rpc/v0' -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"jsonrpc": "2.0","method": "Filecoin.WalletBalance",
"params": ["t1jdlfl73voaiblrvn2yfivvn5ifucwwv5f26nfza"],"id": 0}'
* About to connect() to 172.17.0.2 port 1234 (#0)
* Trying 172.17.0.2...
* Adding handle: conn: 0x56b39cb8
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x56b39cb8) send_pipe: 1, recv_pipe: 0
* Connected to 172.17.0.2 (172.17.0.2) port 1234 (#0)
> POST /rpc/v0 HTTP/1.1
> User-Agent: curl/7.30.0
> Host: 172.17.0.2:1234
> Content-Type: application/json
> Accept: application/json
> Content-Length: 117
>
* upload completely sent off: 117 out of 117 bytes
< HTTP/1.1 200 OK
< Date: Tue, 19 May 2020 15:00:26 GMT
< Content-Length: 38
< Content-Type: text/plain; charset=utf-8
<
{"jsonrpc":"2.0","result":"0","id":0}
* Connection #0 to host 172.17.0.2 left intact

**Version (run `lotus --version`):**
0.3.0'+git9a0d0511'+api0.3.0

**Additional context**

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.