INFURA / infura

Official Public Repository for INFURA
https://infura.io
380 stars 62 forks source link

Wrong content type in JSON-RPC #158

Closed dgaviola closed 5 years ago

dgaviola commented 5 years ago

When I'm calling the the JSON-RPC API I'm getting the correct response, but Content-Type is text/plain. For example I'm doing this call:

curl -v -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}' "https://mainnet.infura.io/api-key"

And the response I'm getting is:

< HTTP/1.1 200 OK
< Date: Tue, 13 Nov 2018 13:40:37 GMT
< Content-Type: text/plain; charset=utf-8
< Content-Length: 44
< Connection: keep-alive
< Vary: Origin
< 
* Connection #0 to host mainnet.infura.io left intact
{"jsonrpc":"2.0","id":1,"result":"0x6630ad"}

So the response is a valid JSON, but Content-Type is wrong, which is a problem when you use tools that read the response's content type to determine how to parse the body.

ryanschneider commented 5 years ago

Very strange, this is definitely a regression on our end, thanks for reporting!

rakeshgohel01 commented 5 years ago

I'm still facing the same issue, any update on this?

ryanschneider commented 5 years ago

Sorry for the delay, we've been short staffed between holidays and team members traveling, but we expect to release this fix alongside other changes coming sometime this week, hopefully today or tomorrow.

ryanschneider commented 5 years ago

The fix for this went live with yesterday's code push.