Skip to content

Commit

Permalink
Improve fetch errors with looser mime-type detection (#1047).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Sep 16, 2020
1 parent e8a9eea commit 263bfe5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/web/src.ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) { };
Expand Down

0 comments on commit 263bfe5

Please sign in to comment.