mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-11 09:51:30 +00:00
@@ -288,13 +288,16 @@ const prepareRequest = async (item = {}, collection = {}) => {
|
||||
request.body = request.body || {};
|
||||
|
||||
if (request.body.mode === 'json') {
|
||||
if (!contentTypeDefined) {
|
||||
axiosRequest.headers['content-type'] = 'application/json';
|
||||
}
|
||||
try {
|
||||
axiosRequest.data = decomment(request?.body?.json);
|
||||
} catch (error) {
|
||||
axiosRequest.data = request?.body?.json;
|
||||
const jsonBody = request.body.json;
|
||||
if (jsonBody && jsonBody.length > 0) {
|
||||
if (!contentTypeDefined) {
|
||||
axiosRequest.headers['content-type'] = 'application/json';
|
||||
}
|
||||
try {
|
||||
axiosRequest.data = decomment(jsonBody);
|
||||
} catch (error) {
|
||||
axiosRequest.data = jsonBody;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ export const toBrunoAuth = (auth: Auth | null | undefined): BrunoAuth | null =>
|
||||
case 'bearer':
|
||||
brunoAuth.mode = 'bearer';
|
||||
brunoAuth.bearer = {
|
||||
token: auth.token || null
|
||||
token: auth.token || ''
|
||||
};
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user