From 7ce6e316a7c9f80a1d3b51d48a28cfdc6d9fb889 Mon Sep 17 00:00:00 2001 From: drbourbon Date: Tue, 27 Jan 2026 13:54:27 +0100 Subject: [PATCH 1/2] aggiunto basic auth per accedere con mio CWA --- lib/KOReaderSync/KOReaderSyncClient.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/KOReaderSync/KOReaderSyncClient.cpp b/lib/KOReaderSync/KOReaderSyncClient.cpp index c5053c64..c99e43e8 100644 --- a/lib/KOReaderSync/KOReaderSyncClient.cpp +++ b/lib/KOReaderSync/KOReaderSyncClient.cpp @@ -19,6 +19,9 @@ 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()); + + // [FIXME] FB hack per mio CWA che non autentica con x-auth-user + http.setAuthorization(KOREADER_STORE.getUsername().c_str(), KOREADER_STORE.getPassword().c_str()); } bool isHttpsUrl(const std::string& url) { return url.rfind("https://", 0) == 0; } From f0ee1f179fb7e6d6756411df94e1ab505c94697d Mon Sep 17 00:00:00 2001 From: drbourbon Date: Wed, 28 Jan 2026 14:36:51 +0100 Subject: [PATCH 2/2] Add HTTP Basic Auth (RFC 7617) header to KOsync to supporto CWA embedded sync server --- lib/KOReaderSync/KOReaderSyncClient.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/KOReaderSync/KOReaderSyncClient.cpp b/lib/KOReaderSync/KOReaderSyncClient.cpp index c99e43e8..f0183452 100644 --- a/lib/KOReaderSync/KOReaderSyncClient.cpp +++ b/lib/KOReaderSync/KOReaderSyncClient.cpp @@ -20,7 +20,8 @@ void addAuthHeaders(HTTPClient& http) { http.addHeader("x-auth-user", KOREADER_STORE.getUsername().c_str()); http.addHeader("x-auth-key", KOREADER_STORE.getMd5Password().c_str()); - // [FIXME] FB hack per mio CWA che non autentica con x-auth-user + // 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()); }