Description
getResponseBody() checks Content-Type using strict equality to 'application/json'. Real APIs commonly return 'application/json; charset=utf-8'. In that case, the function falls back to response.text() and returns a string instead of parsed JSON, causing downstream runtime failures when callers access object properties.
Severity: high
File: src/frontend/js/api/utils.ts
Expected Behavior
The code should handle this case properly to avoid unexpected errors or degraded quality.
Description
getResponseBody()checksContent-Typeusing strict equality to'application/json'. Real APIs commonly return'application/json; charset=utf-8'. In that case, the function falls back toresponse.text()and returns a string instead of parsed JSON, causing downstream runtime failures when callers access object properties.Severity:
highFile:
src/frontend/js/api/utils.tsExpected Behavior
The code should handle this case properly to avoid unexpected errors or degraded quality.