-
Notifications
You must be signed in to change notification settings - Fork 53
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
bug: RPC endpoint returns text/html as content type #1783
Comments
Edited: the next comment is incorrect.Afternoon @jakubgs, Checking the However, I've noticed that the Content-Type present in the response is exactly the same as the one given in the request: What if we add the next snippet in https://github.com/status-im/infra-role-nim-waku/blob/eed1a10ccea90c3b33af845ba54334530467a625/tasks/query.yml#L10 ?
|
I already do that:
Doesn't work. |
Also, doesn't work for Ansible either. Already tried that, since it was an obvious thing to test. |
Ok, please ignore my last comment. It actually returns the type "text/html" too. |
Looking at the json_rpc implementation (https://github.com/status-im/nim-json-rpc) I don't see a way to explicitly enforce headers (neither in server setup nor in method execution) which is kinda weird cause returning JSON as text/html is definitelly a problem |
I think I saw what needs to be changed. I'll submit the PR to that repo shortly. |
We'll need to get this merged and then, update the submodule accordingly in Sorry for the previous confusion! |
Problem
RPC endpoint sets
Content-Type: text/html; charset=utf-8
when returning a JSON response.Impact
Ansible
2.13
- or more exactlyuri
module - is more strict about HTTP response content types, and I no longer get the actual JSON response when I query the RPC API usinguri
task;https://github.com/status-im/infra-role-nim-waku/blob/eed1a10ccea90c3b33af845ba54334530467a625/tasks/query.yml#L7-L19
To reproduce
Just query the RPC:
Expected behavior
The
go-waku
node does this correctly:nwaku version/commit hash
The text was updated successfully, but these errors were encountered: