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

JSON-RPC server should reply with parse error if request is not valid JSON #2510

Closed
alexghr opened this issue Sep 25, 2023 · 0 comments · Fixed by #2590
Closed

JSON-RPC server should reply with parse error if request is not valid JSON #2510

alexghr opened this issue Sep 25, 2023 · 0 comments · Fixed by #2590
Assignees

Comments

@alexghr
Copy link
Contributor

alexghr commented Sep 25, 2023

According to the JSON-RPC 2.0 spec if the server receives an badly formed request and fails to parse it as JSON then the server should reply with:

{"jsonrpc": "2.0", "error": {"code": -32700, "message": "Parse error"}, "id": null}

Reference: https://www.jsonrpc.org/specification#error_object

@alexghr alexghr self-assigned this Sep 28, 2023
alexghr added a commit that referenced this issue Oct 3, 2023
Fix #2510 

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [x] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [x] Every change is related to the PR description.
- [x] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
Maddiaa0 pushed a commit that referenced this issue Oct 6, 2023
Fix #2510 

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [x] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [x] Every change is related to the PR description.
- [x] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant