From b16a4445aef89b6fbc736bd51a6fb4612b4a964f Mon Sep 17 00:00:00 2001 From: IGCFck <61951310+IGCFck@users.noreply.github.com> Date: Mon, 2 Mar 2026 00:01:47 +0100 Subject: [PATCH] fix(opds): handle non-ASCII login details (#3436) --- apps/readest-app/src/app/opds/utils/opdsReq.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/readest-app/src/app/opds/utils/opdsReq.ts b/apps/readest-app/src/app/opds/utils/opdsReq.ts index 30619db1..a70a67bd 100644 --- a/apps/readest-app/src/app/opds/utils/opdsReq.ts +++ b/apps/readest-app/src/app/opds/utils/opdsReq.ts @@ -176,8 +176,10 @@ export const createDigestAuth = async ( * Create Basic Authorization header */ export const createBasicAuth = (username: string, password: string): string => { - const credentials = btoa(`${username}:${password}`); - return `Basic ${credentials}`; + const credentials = `${username}:${password}`; + const utf8Bytes = new TextEncoder().encode(credentials); + const encoded = btoa(String.fromCharCode(...utf8Bytes)); + return `Basic ${encoded}`; }; /**