fix(core): handle Content-Type with charset in fetch error handling (#10777)

This commit is contained in:
fengmk2
2025-03-12 09:56:41 +00:00
parent 01151ec18f
commit 3417cc5dc1

View File

@@ -85,7 +85,7 @@ export class FetchService extends Service {
stacktrace: error.stack,
});
} else {
if (res.headers.get('Content-Type') === 'application/json') {
if (res.headers.get('Content-Type')?.startsWith('application/json')) {
throw UserFriendlyError.fromAny(await res.json());
} else {
throw UserFriendlyError.fromAny(await res.text());