https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36369 --- Comment #21 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 199844 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199844&action=edit Bug 36369: (follow-up) Move CSRF token handling from HttpClient to KohaApiClient HttpClient is a generic HTTP utility with no knowledge of Koha. CSRF tokens are a Koha API concern: generated server-side by Koha::Token->generate_csrf() and embedded in the page's meta tag. This patch moves CSRF responsibility to the correct layer: - KohaApiClient._readCsrfToken() reads the token from the DOM - KohaApiClient._withCsrf() injects the CSRF-TOKEN header into state-changing requests (post, put, patch, delete) - HttpClient no longer has any CSRF awareness This makes HttpClient reusable as a generic fetch wrapper, and keeps Koha-specific API semantics (embed, CSRF) centralized in KohaApiClient. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.