mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-08 14:35:03 +00:00
fix: decomment not working in json body (#1819)
Request body json was not decommented if json parsing fails, which would happen if variables are not quoted. Fixes usebruno#888
This commit is contained in:
@@ -76,10 +76,11 @@ const prepareRequest = (request, collectionRoot) => {
|
||||
if (!contentTypeDefined) {
|
||||
axiosRequest.headers['content-type'] = 'application/json';
|
||||
}
|
||||
const jsonBody = decomment(request.body.json);
|
||||
try {
|
||||
axiosRequest.data = JSONbig.parse(decomment(request.body.json));
|
||||
axiosRequest.data = JSONbig.parse(jsonBody);
|
||||
} catch (ex) {
|
||||
axiosRequest.data = request.body.json;
|
||||
axiosRequest.data = jsonBody;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user