Skip to content

Commit

Permalink
Don't process response body for response status 204
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Nino Walter committed Mar 5, 2024
1 parent fe53330 commit 17adc8c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/src/core-plugins.ts
Expand Up @@ -392,7 +392,11 @@ export class CapacitorHttpPluginWeb
data = await readBlobAsBase64(blob);
break;
case 'json':
data = await response.json();
try {
data = await response.json();
} catch (e) {
data = '';
}
break;
case 'document':
case 'text':
Expand Down

0 comments on commit 17adc8c

Please sign in to comment.