Improve fetch errors with looser mime-type detection (#1047).
This commit is contained in:
parent
e8a9eea493
commit
263bfe5ce6
@ -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) { };
|
||||
|
Loading…
Reference in New Issue
Block a user