Browse Source

fix: GDrive block upload file not working (#1388)

Ahmad Kholid 1 year ago
parent
commit
bc92f2d054
1 changed files with 1 additions and 4 deletions
  1. 1 4
      src/utils/api.js

+ 1 - 4
src/utils/api.js

@@ -205,10 +205,7 @@ export async function fetchGapi(url, resource = {}, options = {}) {
       resource
     );
 
-    const isResJson = response.headers
-      .get('content-type')
-      ?.includes('application/json');
-    const result = isResJson && (await response.json());
+    const result = parseJSON(await response.text(), null);
     const insufficientScope =
       response.status === 403 &&
       result?.error?.message.includes('insufficient authentication scopes');