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

RPC call returns wrong content-type #43

Open
keeperlink opened this issue May 19, 2020 · 2 comments
Open

RPC call returns wrong content-type #43

keeperlink opened this issue May 19, 2020 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@keeperlink
Copy link

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

@whyrusleeping
Copy link
Member

this seems like a bug in the rpc library. we should fix it.

@jennijuju
Copy link
Member

should probably be transfer to go-jsonrpc repo

@arajasek arajasek transferred this issue from filecoin-project/lotus Jan 4, 2021
@magik6k magik6k added bug Something isn't working good first issue Good for newcomers labels Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants