Skip to content

fix(frontend): incorrect json detection for content-type with charset causes wrong response parsing #2773

Description

@huyhoang171106

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions