fix(opds): handle non-ASCII login details (#3436)

This commit is contained in:
IGCFck
2026-03-02 00:01:47 +01:00
committed by GitHub
parent 515d47e64d
commit b16a4445ae
@@ -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}`;
};
/**