mirror of
https://github.com/usebruno/bruno.git
synced 2024-12-23 15:19:01 +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',
|
state: 'success',
|
||||||
data: response.data,
|
data: response.data,
|
||||||
headers: Object.entries(response.headers),
|
headers: Object.entries(response.headers),
|
||||||
size: response.headers['content-length'] || 0,
|
size: getResponseSize(response),
|
||||||
status: response.status,
|
status: response.status,
|
||||||
statusText: response.statusText,
|
statusText: response.statusText,
|
||||||
duration: response.duration
|
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) => {
|
export const fetchGqlSchema = async (endpoint, environment, request, collection) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const { ipcRenderer } = window;
|
const { ipcRenderer } = window;
|
||||||
|
Loading…
Reference in New Issue
Block a user