mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
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,
|
||||
});
|
||||
} 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());
|
||||
|
||||
Reference in New Issue
Block a user