bruno
bruno copied to clipboard
JSON body is quoted when invalid
I have checked the following:
- [X] I use the newest version of bruno.
- [X] I've searched existing issues and found nothing related to my issue.
Describe the bug
Hello,
VERSION : 1.12.3.
When sending a POST request with valid JSON in the body, the body is sent without any modification.
When sending a POST request with invalid JSON in the body, the body is quoted before being sent.
This behavior only occurs when the selected content type is JSON. When sending text, invalid XML or SPARQL, the body is not quoted. There is no indication in the timeline view that the body is quoted.
I'm conscious that I'm complaining that Bruno prevents me from shooting myself in the foot, but I'm working on an API that, for legacy purposes, needs to accept requests containing invalid JSON in the body, and a text/json content type. And I can't test my implementation because of this behavior.
A setting to configure this behavior, and some cues that it happens would be nice.
I would be glad to contribute to fix this issue !
.bru file to reproduce the bug
Screenshots/Live demo link
Here are the bodies the requests recieved by a beeceptor endpoint :
As you can see, the data section doesn't show that quotes are being added to the request
I'm facing the exact same issue. With Bruno 1.16.1 (desktop, not CLI), I could use in a Pre Request Script req.setBody(Buffer.from("the text"))
and the raw value without quotes was sent. With Bruro 1.17 this hack stopped working.
This issue has deteriorated after 1.27.0,
Bruno now IMPLICITLY sends quoted requests.
Just merged the PR for this. This should be available in the upcoming v1.29.0
release