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

JSONRPC return incorrect Content-Type header #7364

Open
8 of 18 tasks
kshinn opened this issue Sep 21, 2021 · 4 comments
Open
8 of 18 tasks

JSONRPC return incorrect Content-Type header #7364

kshinn opened this issue Sep 21, 2021 · 4 comments
Assignees
Labels

Comments

@kshinn
Copy link

kshinn commented Sep 21, 2021

Checklist

  • This is not a security-related bug/issue. If it is, please follow please follow the security policy.
  • This is not a question or a support request. If you have any lotus related questions, please ask in the lotus forum.
  • This is not a new feature request. If it is, please file a feature request instead.
  • This is not an enhancement request. If it is, please file a improvement suggestion instead.
  • I have searched on the issue tracker and the lotus forum, and there is no existing related issue or discussion.
  • I am running the Latest release, or the most recent RC(release canadiate) for the upcoming release or the dev branch(master), or have an issue updating to any of these.
  • I did not make any code changes to lotus.

Lotus component

  • lotus daemon - chain sync
  • lotus miner - mining and block production
  • lotus miner/worker - sealing
  • lotus miner - proving(WindowPoSt)
  • lotus miner/market - storage deal
  • lotus miner/market - retrieval deal
  • lotus miner/market - data transfer
  • lotus client
  • lotus JSON-RPC API
  • lotus message management (mpool)
  • Other

Lotus Version

Daemon:  1.11.1+mainnet+git.15d90c2+api1.3.0
Local: lotus version 1.11.1+mainnet+git.15d90c2

Describe the Bug

Minor point that does not affect functionality, but it seems that the client is returning an incorrect Content-Type header. The body of the response is correct, but the response header is wrong.

Currently it is returning:

Content-Type: text/plain

For the api, it is more correct to return

Content-Type: application/json

For the most part, the bug is not affecting the usage of the API. There are some http clients that may have trouble with auto-negotiating the content type for deserialization.

Logging Information

n/a

Repo Steps

  1. Run the node with the RPC enabled
  2. Query any JSONRPC method
  3. See that the response header Content-Type is text/plain
@TippyFlitsUK
Copy link
Contributor

Hi @kshinn

Testing with 1.15.0 confirms that this has been resolved.

Thanks again!

@pyropy
Copy link

pyropy commented Nov 7, 2022

@TippyFlitsUK Seems like bug is still present in version v1.17.2

@svilenkov
Copy link

Confirming the same for 1.17.1-rc3+mainnet+git.079dab0d7

curl -i \
  --request POST \
  --url http://127.0.0.1:1234/rpc/v0 \
  --header 'Content-Type: application/json' \
  --data '{
	"jsonrpc": "2.0",
	"method": "Filecoin.ChainHead",
	"params": [],
	"id": 3
}'
HTTP/1.1 200 OK
Date: Mon, 07 Nov 2022 09:43:35 GMT
Content-Type: text/plain; charset=utf-8
Transfer-Encoding: chunked

@Reiers Reiers reopened this Nov 7, 2022
@shou1dwe
Copy link

This is probably related to filecoin-project/go-jsonrpc#43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants