We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0c03956 + 5756ebd commit 5125900Copy full SHA for 5125900
1 file changed
src/App/src/utils/httpClient.ts
@@ -68,6 +68,10 @@ class HttpClient {
68
if (!response.ok) {
69
throw new Error(`${config.method || 'GET'} ${url} failed: ${response.statusText}`);
70
}
71
+ const contentType = response.headers.get('content-type') || '';
72
+ if (!contentType.toLowerCase().includes('application/json')) {
73
+ throw new Error(`${config.method || 'GET'} ${url} returned non-JSON response (content-type: ${contentType || 'unknown'})`);
74
+ }
75
return response.json();
76
77
0 commit comments