You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've searched existing issues and found nothing related to my issue.
Describe the bug
Bruno crashes when handling a server response that returns "true" with the application/json content type. This occurs when sending a request to the Dokploy API in my case (/api/application.update). The issue seems related to Bruno attempting to parse the "true" response, which is not valid JSON, leading to a crash.
Steps to Reproduce:
Send a request to an endpoint that responds with "true" and sets the Content-Type header to application/json.
Observe that Bruno crashes after receiving this response.
Confirm that Bruno handles responses properly when valid JSON (e.g., a 400 Bad Request response) is returned from the server.
Expected Behavior:
Bruno should be able to handle and display non-JSON responses like "true" without crashing, especially when the content type is application/json.
Actual Behavior:
When the response is "true", Bruno crashes due to invalid JSON parsing.
If the server returns valid JSON (e.g., an error response), Bruno displays the response without issues.
Additional Context:
The response "true" is sent with the application/json content type, which is technically incorrect, but Bruno should still handle this gracefully.
e.g.:
Returning this in Symfony Controller will make bruno crash
TheoD02
changed the title
Bruno API Client crashes when parsing non-JSON success response
Bruno crashes when parsing non-JSON success response
Sep 17, 2024
TheoD02
added a commit
to TheoD02/bruno
that referenced
this issue
Sep 17, 2024
* fix: handle case of text when invalid JSON (#3119)
* don't stringify if json is invalid, and maintain indentation if stringified
* stringify check
---------
Co-authored-by: lohit <[email protected]>
I have checked the following:
Describe the bug
Bruno crashes when handling a server response that returns
"true"
with theapplication/json
content type. This occurs when sending a request to the Dokploy API in my case (/api/application.update
). The issue seems related to Bruno attempting to parse the"true"
response, which is not valid JSON, leading to a crash.Steps to Reproduce:
"true"
and sets theContent-Type
header toapplication/json
.Expected Behavior:
Bruno should be able to handle and display non-JSON responses like
"true"
without crashing, especially when the content type isapplication/json
.Actual Behavior:
"true"
, Bruno crashes due to invalid JSON parsing.Additional Context:
"true"
is sent with theapplication/json
content type, which is technically incorrect, but Bruno should still handle this gracefully.e.g.:
Returning this in Symfony Controller will make bruno crash
.bru file to reproduce the bug
No response
Screenshots/Live demo link
The text was updated successfully, but these errors were encountered: