Skip to content

2.0.0

Latest

Choose a tag to compare

@Agbokoudjo Agbokoudjo released this 26 Jul 11:06
· 1 commit to main since this release

[2.0.0]

Added

  • HttpRedirectResponseError — surfaces server redirects explicitly instead of
    letting them silently corrupt or crash a response.
  • isJSONResponse utility.

Fixed

  • safeFetch/responseTypeHandle no longer throw a cryptic SyntaxError
    when a json/formData request is redirected to non-JSON content
    (e.g. session expired → login page).

BREAKING CHANGE

  • responseType: 'text' | 'blob' | 'arrayBuffer' | 'stream' now throws
    HttpRedirectResponseError on any redirect (raw 3xx or auto-followed),
    including previously-silent cases like a CDN redirecting a file download.
    Previously these response types never threw on redirect. If your code
    relies on transparently following redirects for these types, catch
    HttpRedirectResponseError and handle it explicitly.