mirror of
https://github.com/Dictionarry-Hub/profilarr.git
synced 2026-01-22 10:51:02 +01:00
fix: handle empty response body in HTTP client
This commit is contained in:
@@ -75,8 +75,9 @@ export class BaseHttpClient {
|
||||
|
||||
clearTimeout(timeoutId);
|
||||
|
||||
// Parse response
|
||||
const data = await response.json();
|
||||
// Parse response - handle empty body (common for DELETE)
|
||||
const text = await response.text();
|
||||
const data = text ? JSON.parse(text) : null;
|
||||
|
||||
// Check for HTTP errors
|
||||
if (!response.ok) {
|
||||
|
||||
Reference in New Issue
Block a user