From d6378133d83150d1253819235d42e5f37e4cf6ed Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Fri, 3 Dec 2021 11:23:10 +0530 Subject: [PATCH] Remove length property --- src/matrix/net/common.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/matrix/net/common.ts b/src/matrix/net/common.ts index 9c476dd6..5fd5c963 100644 --- a/src/matrix/net/common.ts +++ b/src/matrix/net/common.ts @@ -20,7 +20,6 @@ import {BlobHandle} from "../../platform/web/dom/BlobHandle.js"; export type EncodedBody = { mimeType: string; body: BlobHandle | string; - length: number; } export function encodeQueryParams(queryParams?: Record): string { @@ -40,15 +39,13 @@ export function encodeBody(body: BlobHandle | Record): EncodedBody const blob = body as BlobHandle; return { mimeType: blob.mimeType, - body: blob, // will be unwrapped in request fn - length: blob.size + body: blob // will be unwrapped in request fn }; } else if (typeof body === "object") { const json = JSON.stringify(body); return { mimeType: "application/json", - body: json, - length: json.length + body: json } } else { throw new Error("Unknown body type: " + body);