mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-07 16:44:27 +01:00
fix: add response size in response pane
This commit is contained in:
parent
1979be6c4b
commit
32629cdcca
@ -7,7 +7,7 @@ export const sendNetworkRequest = async (item, collection, environment, collecti
|
||||
state: 'success',
|
||||
data: response.data,
|
||||
headers: Object.entries(response.headers),
|
||||
size: response.headers['content-length'] || 0,
|
||||
size: getResponseSize(response),
|
||||
status: response.status,
|
||||
statusText: response.statusText,
|
||||
duration: response.duration
|
||||
@ -29,6 +29,10 @@ const sendHttpRequest = async (item, collection, environment, collectionVariable
|
||||
});
|
||||
};
|
||||
|
||||
const getResponseSize = (response) => {
|
||||
return response.headers['content-length'] || Buffer.byteLength(JSON.stringify(response.data)) || 0;
|
||||
};
|
||||
|
||||
export const fetchGqlSchema = async (endpoint, environment, request, collection) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const { ipcRenderer } = window;
|
||||
|
Loading…
Reference in New Issue
Block a user