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

soroban-rpc: doesn't allow content-type charset=utf8 #1075

Closed
leighmcculloch opened this issue Nov 9, 2023 · 0 comments · Fixed by #1095
Closed

soroban-rpc: doesn't allow content-type charset=utf8 #1075

leighmcculloch opened this issue Nov 9, 2023 · 0 comments · Fixed by #1095
Assignees
Labels
bug Something isn't working

Comments

@leighmcculloch
Copy link
Member

What version are you using?

20.0.0-rc4 bce5e56

What did you do?

Make a request with the Content-Type header set to application/json; charset=utf-8.

What did you expect to see?

The same output as when Content-Type: application/json is provided:

❯ curl -v -s http://localhost:8000/soroban/rpc \
  --request POST \
  --header "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","id":"", "method":"getHealth"}'
*   Trying 127.0.0.1:8000...
* Connected to localhost (127.0.0.1) port 8000 (#0)
> POST /soroban/rpc HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/8.1.2
> Accept: */*
> Content-Type: application/json
> Content-Length: 47
> 
< HTTP/1.1 200 OK
< Server: nginx/1.18.0 (Ubuntu)
< Date: Thu, 09 Nov 2023 20:02:54 GMT
< Content-Type: application/json
< Content-Length: 55
< Connection: keep-alive
< Accept-Post: application/json
< Vary: Origin
< Vary: Origin
< 
* Connection #0 to host localhost left intact
{"jsonrpc":"2.0","id":"","result":{"status":"healthy"}}%                         

What did you see instead?

$ curl -v -s http://localhost:8000/soroban/rpc \
  --request POST \
  --header "Content-Type: application/json; charset=utf-8" \
  --data '{"jsonrpc":"2.0","id":"", "method":"getHealth"}'
*   Trying 127.0.0.1:8000...
* Connected to localhost (127.0.0.1) port 8000 (#0)
> POST /soroban/rpc HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/8.1.2
> Accept: */*
> Content-Type: application/json; charset=utf-8
> Content-Length: 47
> 
< HTTP/1.1 415 Unsupported Media Type
< Server: nginx/1.18.0 (Ubuntu)
< Date: Thu, 09 Nov 2023 20:01:51 GMT
< Content-Length: 0
< Connection: keep-alive
< Accept-Post: application/json
< Vary: Origin
< Vary: Origin
< 
* Connection #0 to host localhost left intact
@leighmcculloch leighmcculloch added the bug Something isn't working label Nov 9, 2023
@mollykarcher mollykarcher moved this from Backlog to Next Sprint Proposal in Platform Scrum Nov 15, 2023
@mollykarcher mollykarcher added this to the Soroban Pubnet Release milestone Nov 15, 2023
@aditya1702 aditya1702 moved this from Next Sprint Proposal to In Progress in Platform Scrum Nov 17, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Platform Scrum Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
3 participants