diff --git a/packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/Request/index.js b/packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/Request/index.js
index b81d3821a..1cef8e9e5 100644
--- a/packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/Request/index.js
+++ b/packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/Request/index.js
@@ -1,8 +1,26 @@
import Headers from "../Common/Headers/index";
import BodyBlock from "../Common/Body/index";
+const safeStringifyJSONIfNotString = (obj) => {
+ if (obj === null || obj === undefined) return '';
+
+ if (typeof obj === 'string') {
+ return obj;
+ }
+
+ try {
+ return JSON.stringify(obj);
+ } catch (e) {
+ return '[Unserializable Object]';
+ }
+};
+
+
const Request = ({ collection, request, item, width }) => {
- const { url, headers, data, dataBuffer, error } = request || {};
+ let { url, headers, data, dataBuffer, error } = request || {};
+ if (!dataBuffer) {
+ dataBuffer = Buffer.from(safeStringifyJSONIfNotString(data))?.toString('base64');
+ }
return (
diff --git a/packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/Response/index.js b/packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/Response/index.js
index 5ee182c64..c70825eb9 100644
--- a/packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/Response/index.js
+++ b/packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/Response/index.js
@@ -2,8 +2,25 @@ import BodyBlock from "../Common/Body/index";
import Headers from "../Common/Headers/index";
import Status from "../Common/Status/index";
+const safeStringifyJSONIfNotString = (obj) => {
+ if (obj === null || obj === undefined) return '';
+
+ if (typeof obj === 'string') {
+ return obj;
+ }
+
+ try {
+ return JSON.stringify(obj);
+ } catch (e) {
+ return '[Unserializable Object]';
+ }
+};
+
const Response = ({ collection, response, item, width }) => {
- const { status, statusCode, statusText, headers, data, dataBuffer, error } = response || {};
+ let { status, statusCode, statusText, dataBuffer, headers, data, error } = response || {};
+ if (!dataBuffer) {
+ dataBuffer = Buffer.from(safeStringifyJSONIfNotString(data))?.toString('base64');
+ }
return (
diff --git a/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js b/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
index 9afb36cc9..1d6678ab6 100644
--- a/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
+++ b/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
@@ -1282,7 +1282,7 @@ export const fetchOauth2Credentials = (payload) => async (dispatch, getState) =>
url,
collectionUid,
credentialsId,
- debugInfo,
+ debugInfo: safeParseJSON(safeStringifyJSON(debugInfo)),
folderUid: folderUid || null,
itemUid: !folderUid ? itemUid : null
})
@@ -1305,7 +1305,7 @@ export const refreshOauth2Credentials = (payload) => async (dispatch, getState)
url,
collectionUid,
credentialsId,
- debugInfo,
+ debugInfo: safeParseJSON(safeStringifyJSON(debugInfo)),
folderUid: folderUid || null,
itemUid: !folderUid ? itemUid : null
})
diff --git a/packages/bruno-app/src/utils/common/index.js b/packages/bruno-app/src/utils/common/index.js
index 8ab235426..8bafbb8f9 100644
--- a/packages/bruno-app/src/utils/common/index.js
+++ b/packages/bruno-app/src/utils/common/index.js
@@ -181,4 +181,4 @@ export const getEncoding = (headers) => {
// Parse the charset from content type: https://stackoverflow.com/a/33192813
const charsetMatch = /charset=([^()<>@,;:"/[\]?.=\s]*)/i.exec(headers?.['content-type'] || '');
return charsetMatch?.[1];
-}
+}
\ No newline at end of file
diff --git a/packages/bruno-electron/src/ipc/network/axios-instance.js b/packages/bruno-electron/src/ipc/network/axios-instance.js
index 32f8a2cdc..91cb28535 100644
--- a/packages/bruno-electron/src/ipc/network/axios-instance.js
+++ b/packages/bruno-electron/src/ipc/network/axios-instance.js
@@ -275,7 +275,6 @@ function makeAxiosInstance({
statusText: error.response.statusText,
headers: error.response.headers,
data: errorResponseData?.toString?.(),
- dataBuffer: dataBuffer,
size: Buffer.byteLength(dataBuffer),
duration: error.response.headers.get('request-duration') ?? 0,
timeline: error.response.timeline
@@ -363,7 +362,6 @@ function makeAxiosInstance({
statusText: error.response.statusText,
headers: error.response.headers,
data: errorResponseData?.toString?.(),
- dataBuffer: dataBuffer,
size: Buffer.byteLength(dataBuffer),
duration: error.response.headers.get('request-duration') ?? 0,
timeline
diff --git a/packages/bruno-electron/src/utils/oauth2.js b/packages/bruno-electron/src/utils/oauth2.js
index e1cab76ad..ce7b32abd 100644
--- a/packages/bruno-electron/src/utils/oauth2.js
+++ b/packages/bruno-electron/src/utils/oauth2.js
@@ -158,7 +158,6 @@ const getOAuth2TokenUsingAuthorizationCode = async ({ request, collectionUid, fo
url: config.url,
headers: config.headers,
data: requestData,
- dataBuffer: Buffer.from(requestData),
timestamp: Date.now(),
};
return config;
@@ -220,14 +219,12 @@ const getOAuth2TokenUsingAuthorizationCode = async ({ request, collectionUid, fo
method: axiosRequestInfo?.method,
headers: axiosRequestInfo?.headers || {},
data: axiosRequestInfo?.data,
- dataBuffer: axiosRequestInfo?.dataBuffer,
error: null
},
response: {
url: axiosResponseInfo?.url,
headers: axiosResponseInfo?.headers,
data: parsedResponseData,
- dataBuffer: axiosResponseInfo?.data,
status: axiosResponseInfo?.status,
statusText: axiosResponseInfo?.statusText,
error: axiosResponseInfo?.error,
@@ -386,7 +383,6 @@ const getOAuth2TokenUsingClientCredentials = async ({ request, collectionUid, fo
url: config.url,
headers: config.headers,
data: requestData,
- dataBuffer: Buffer.from(requestData),
timestamp: Date.now(),
};
return config;
@@ -442,14 +438,12 @@ const getOAuth2TokenUsingClientCredentials = async ({ request, collectionUid, fo
method: axiosRequestInfo?.method,
headers: axiosRequestInfo?.headers || {},
data: axiosRequestInfo?.data,
- dataBuffer: axiosRequestInfo?.dataBuffer,
error: null
},
response: {
url: axiosResponseInfo.url,
headers: axiosResponseInfo?.headers,
data: parsedResponseData,
- dataBuffer: axiosResponseInfo?.data,
status: axiosResponseInfo?.status,
statusText: axiosResponseInfo?.statusText,
timeline: axiosResponseInfo?.timeline,
@@ -576,7 +570,6 @@ const getOAuth2TokenUsingPasswordCredentials = async ({ request, collectionUid,
url: config.url,
headers: config.headers,
data: requestData,
- dataBuffer: Buffer.from(requestData),
timestamp: Date.now(),
};
return config;
@@ -631,14 +624,12 @@ const getOAuth2TokenUsingPasswordCredentials = async ({ request, collectionUid,
method: axiosRequestInfo?.method,
headers: axiosRequestInfo?.headers || {},
data: axiosRequestInfo?.data,
- dataBuffer: axiosRequestInfo?.dataBuffer,
error: null
},
response: {
url: axiosResponseInfo?.url,
headers: axiosResponseInfo?.headers,
data: parsedResponseData,
- dataBuffer: axiosResponseInfo?.data,
status: axiosResponseInfo?.status,
statusText: axiosResponseInfo?.statusText,
timeline: axiosResponseInfo?.timeline,
@@ -697,7 +688,6 @@ const refreshOauth2Token = async (requestCopy, collectionUid) => {
url: config.url,
headers: config.headers,
data: requestData,
- dataBuffer: Buffer.from(requestData),
timestamp: Date.now(),
};
return config;
@@ -755,14 +745,12 @@ const refreshOauth2Token = async (requestCopy, collectionUid) => {
method: axiosRequestInfo?.method,
headers: axiosRequestInfo?.headers || {},
data: axiosRequestInfo?.data,
- dataBuffer: axiosRequestInfo?.dataBuffer,
error: null
},
response: {
url: axiosResponseInfo?.url,
headers: axiosResponseInfo?.headers,
data: parsedResponseData,
- dataBuffer: axiosResponseInfo?.data,
status: axiosResponseInfo?.status,
statusText: axiosResponseInfo?.statusText,
timeline: axiosResponseInfo?.timeline,