Measuring length if no content length supplied.

This commit is contained in:
mike12345567 2021-12-09 13:40:39 +00:00
parent da3df17699
commit cade92cc63
1 changed files with 1 additions and 1 deletions

View File

@ -131,7 +131,7 @@ module RestModule {
data = await response.text() data = await response.text()
raw = data raw = data
} }
const size = formatBytes(response.headers.get("content-length") || 0) const size = formatBytes(response.headers.get("content-length") || Buffer.byteLength(raw, "utf8"))
const time = `${Math.round(performance.now() - this.startTimeMs)}ms` const time = `${Math.round(performance.now() - this.startTimeMs)}ms`
headers = response.headers.raw() headers = response.headers.raw()
for (let [key, value] of Object.entries(headers)) { for (let [key, value] of Object.entries(headers)) {