forked from extern/bruno
Merge pull request #520 from snippetkid/497-show-response-size
Show response size even if content-length header isn't present
This commit is contained in:
commit
de223acb19
@ -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