fix(core): handle Content-Type with charset in fetch error handling (#10777)
This commit is contained in:
@@ -85,7 +85,7 @@ export class FetchService extends Service {
|
|||||||
stacktrace: error.stack,
|
stacktrace: error.stack,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (res.headers.get('Content-Type') === 'application/json') {
|
if (res.headers.get('Content-Type')?.startsWith('application/json')) {
|
||||||
throw UserFriendlyError.fromAny(await res.json());
|
throw UserFriendlyError.fromAny(await res.json());
|
||||||
} else {
|
} else {
|
||||||
throw UserFriendlyError.fromAny(await res.text());
|
throw UserFriendlyError.fromAny(await res.text());
|
||||||
|
|||||||
Reference in New Issue
Block a user