From 17fedd2a691d125879c4071c80671dabd6d02aa9 Mon Sep 17 00:00:00 2001 From: Fabio Barbon Date: Thu, 5 Feb 2026 13:10:08 +0100 Subject: [PATCH] feat: Calibre Web Automated (CWA) koreader sync server support (#594) ## Summary * **What is the goal of this PR?** Provide support to koreader sync server embedded in the popular *Calibre Web Automated* self-hosted digital library solution. * **What changes are included?** * Trivial addition of **HTTP Basic Auth (RFC 7617) header** to `lib/KOReaderSync/KOReaderSyncClient.cpp` ## Additional Context None --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**NO**_ --------- Co-authored-by: drbourbon --- lib/KOReaderSync/KOReaderSyncClient.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/KOReaderSync/KOReaderSyncClient.cpp b/lib/KOReaderSync/KOReaderSyncClient.cpp index c5053c64..f0183452 100644 --- a/lib/KOReaderSync/KOReaderSyncClient.cpp +++ b/lib/KOReaderSync/KOReaderSyncClient.cpp @@ -19,6 +19,10 @@ void addAuthHeaders(HTTPClient& http) { http.addHeader("Accept", "application/vnd.koreader.v1+json"); http.addHeader("x-auth-user", KOREADER_STORE.getUsername().c_str()); http.addHeader("x-auth-key", KOREADER_STORE.getMd5Password().c_str()); + + // HTTP Basic Auth (RFC 7617) header. This is needed to support koreader sync server embedded in Calibre Web Automated + // (https://github.com/crocodilestick/Calibre-Web-Automated/blob/main/cps/progress_syncing/protocols/kosync.py) + http.setAuthorization(KOREADER_STORE.getUsername().c_str(), KOREADER_STORE.getPassword().c_str()); } bool isHttpsUrl(const std::string& url) { return url.rfind("https://", 0) == 0; }