https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43516

--- Comment #1 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 205526
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205526&action=edit
Bug 43516: Harden HttpClient against malformed and unreachable API responses

Guard against malformed JSON in http-client responses (a truncated
body, a proxy error page, a session-expired redirect) instead of
letting the parse error surface as the failure. Preserve the HTTP
status and Koha error_code on thrown errors so callers can branch on
them.

Add a per-request config object to both the plain fetch/http-client.js
and the Vue-composable vue/fetch/http-client.js:
- config.signal cancels the underlying fetch via AbortController.
- config.suppressDefaultErrorDialog lets callers that present their
  own error UI skip the page-level error dialog; the error is still
  thrown with status/code attached.

Test plan:
1. Run: yarn cypress run --component --browser electron --spec
  
't/cypress/component/HttpClient_spec.ts,t/cypress/component/VueHttpClient_spec.ts'
2. Verify all specs pass.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to