From 263bfe5ce632790e0399d06a0ab660a501997998 Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Tue, 15 Sep 2020 22:12:56 -0400 Subject: [PATCH] Improve fetch errors with looser mime-type detection (#1047). --- packages/web/src.ts/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web/src.ts/index.ts b/packages/web/src.ts/index.ts index 700f7698f1..39776cff56 100644 --- a/packages/web/src.ts/index.ts +++ b/packages/web/src.ts/index.ts @@ -23,7 +23,7 @@ function bodyify(value: any, type: string): string { if (typeof(value) === "string") { return value; } if (isBytesLike(value)) { - if (type && (type.split("/")[0] === "text" || type === "application/json")) { + if (type && (type.split("/")[0] === "text" || type.split(";")[0].trim() === "application/json")) { try { return toUtf8String(value); } catch (error) { };