Prevent login loops when the WebUI is protected by HTTP authentication at a reverse proxy. Apply the fix to settings, uploads, and live streams while retaining compatibility with existing WebUI clients. Fixes #523
13 lines
371 B
TypeScript
13 lines
371 B
TypeScript
export const WEBUI_SESSION_HEADER = 'X-SnowLuma-Token';
|
|
|
|
/** Leave Authorization available for HTTP authentication at the reverse proxy. */
|
|
export function webuiSessionHeaders(token: string | null, initial?: HeadersInit): Headers {
|
|
const headers = new Headers(initial);
|
|
|
|
if (token) {
|
|
headers.set(WEBUI_SESSION_HEADER, token);
|
|
}
|
|
|
|
return headers;
|
|
}
|