Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[PAPYRUS-2.2.0-rc] Content type in JSON RPC response #1390

Merged
merged 2 commits into from
Dec 23, 2020

Conversation

ajlopez
Copy link
Contributor

@ajlopez ajlopez commented Dec 8, 2020

fit: 2.2-rc

Description

Add a Content-Type header to JSON RPC responses, with value application/json to solve #1365 1365

Motivation and Context

Current code does not returns the content type header in the responses to JSON RPC invocations.

How Has This Been Tested?

It was tested using curl

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • Tests for the changes have been added (for bug fixes / features)
  • Requires Activation Code (Hard Fork)
  • Other information:

fedejinich
fedejinich previously approved these changes Dec 10, 2020
Copy link
Contributor

@fedejinich fedejinich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@fedejinich
Copy link
Contributor

pipeline:run

@ajlopezrsk
Copy link
Contributor

pipeline:run

@lucasvuotto
Copy link
Contributor

Correct me if I'm wrong, but I recall that RSK only returns JSON objects when the HTTP status is 200. The public node seems to confirm that:

$ curl -v -d '{"jsonrpc":"2.0","id":"pr1390","method":"eth_clientVersion"}' https://public-node.testnet.rsk.co/2.0.1 # note we aren't passing a "Content-Type: application/json" header
...
> POST /2.0.1 HTTP/2
> Host: public-node.testnet.rsk.co
> user-agent: curl/7.68.0
> accept: */*
> content-length: 60
> content-type: application/x-www-form-urlencoded
> 
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
* We are completely uploaded and fine
< HTTP/2 415 
< date: Tue, 15 Dec 2020 17:41:15 GMT
< content-length: 0
< x-varnish-cache: MISS-1
< server: Flex
< x-powered-by: RSK Smart
< 
...

Will we be adding Content-Type: application/json to all the replies from the RPC server?

@ajlopezrsk
Copy link
Contributor

ajlopezrsk commented Dec 15, 2020 via email

@lucasvuotto
Copy link
Contributor

pipeline: run

@alejandrod-iov
Copy link
Contributor

piepline: run

@ajlopezrsk
Copy link
Contributor

pipeline: run

2 similar comments
@Vovchyk
Copy link
Contributor

Vovchyk commented Dec 22, 2020

pipeline: run

@ajlopezrsk
Copy link
Contributor

pipeline: run

@ajlopezrsk
Copy link
Contributor

pipeline: run

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (1.8.0_275) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 11.
Read more here

@ajlopezrsk ajlopezrsk merged commit b706f67 into rsksmart:PAPYRUS-2.2.0-rc Dec 23, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants