-
Notifications
You must be signed in to change notification settings - Fork 179
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] GraphQL server returns 500 when sending empty json payload #2195
Labels
bug
Something isn't working
Comments
9 tasks
000xs
added a commit
to 000xs/guac
that referenced
this issue
Oct 18, 2024
000xs
added a commit
to 000xs/guac
that referenced
this issue
Oct 18, 2024
…o GraphQL server Signed-off-by: Sithum Sathsara <[email protected]>
000xs
added a commit
to 000xs/guac
that referenced
this issue
Oct 18, 2024
Signed-off-by: Sithum Sathsara <[email protected]>
000xs
added a commit
to 000xs/guac
that referenced
this issue
Oct 20, 2024
000xs
added a commit
to 000xs/guac
that referenced
this issue
Oct 20, 2024
Signed-off-by: Sithum Sathsara <[email protected]>
000xs
added a commit
to 000xs/guac
that referenced
this issue
Oct 20, 2024
…o GraphQL server Signed-off-by: Sithum Sathsara <[email protected]>
000xs
added a commit
to 000xs/guac
that referenced
this issue
Oct 20, 2024
…o GraphQL server Signed-off-by: Sithum Sathsara <[email protected]>
000xs
added a commit
to 000xs/guac
that referenced
this issue
Oct 20, 2024
Signed-off-by: Sithum Sathsara <[email protected]>
000xs
added a commit
to 000xs/guac
that referenced
this issue
Oct 20, 2024
…o GraphQL server Signed-off-by: Sithum Sathsara <[email protected]>
000xs
added a commit
to 000xs/guac
that referenced
this issue
Oct 20, 2024
Signed-off-by: Sithum Sathsara <[email protected]>
000xs
added a commit
to 000xs/guac
that referenced
this issue
Oct 20, 2024
Signed-off-by: Sithum Sathsara <[email protected]>
000xs
added a commit
to 000xs/guac
that referenced
this issue
Oct 20, 2024
Signed-off-by: Sithum Sathsara <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When empty or broken JSON is send to the /query endpoint, a 500 internal error is returned, which is mis-leading and should be a 400 bad request instead.
To Reproduce
Steps to reproduce the behavior:
post
request to the/query
endpoint, wih a payload of 0 bytesActual behaviour
Input (raw) sent:
The server returns status 500
unexpected end of JSON input
Raw reponse from the server:
Expected behaviour
Since this is related to user input data, a status code 400 "bad request" should be used.
Also the error message could be a bit more proactive: e.g.
fmt.Sprintf("provided input json couldn't be parsed. likely it was empty or was wrongly structured; error message: %v", err.String()
).When I developed a reverse proxy for the visualizer, I was completely puzzled and mis-lead because of the 500 error and thought of a bigger issue inside GraphQL, looked in to the error logs, but couldn't find. spend too much time thinking, until realizing my error was "just" in the empty json payload.
Screenshots
n/a
GUAC version
build from repository, as of Oct. 14th, 2024
Additional context
n/a
The text was updated successfully, but these errors were encountered: