File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
packages/hoppscotch-kernel/src/relay/impl/web/v Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -222,6 +222,11 @@ export const implementation: VersionedAPI<RelayV1> = {
222222 normalizedHeaders [ "Content-Type" ] ||
223223 normalizedHeaders [ "CONTENT-TYPE" ]
224224
225+ const rawBody = axiosResponse . data
226+ const bodySize = rawBody . byteLength
227+
228+ const headerSize = JSON . stringify ( axiosResponse . headers ) . length
229+
225230 const response : RelayResponse = {
226231 id : request . id ,
227232 status : axiosResponse . status ,
@@ -235,11 +240,9 @@ export const implementation: VersionedAPI<RelayV1> = {
235240 end : endTime ,
236241 } ,
237242 size : {
238- headers : JSON . stringify ( axiosResponse . headers ) . length ,
239- body : axiosResponse . data ?. length ?? 0 ,
240- total :
241- JSON . stringify ( axiosResponse . headers ) . length +
242- ( axiosResponse . data ?. length ?? 0 ) ,
243+ headers : headerSize ,
244+ body : bodySize ,
245+ total : headerSize + bodySize ,
243246 } ,
244247 } ,
245248 }
You can’t perform that action at this time.
0 commit comments