From 611e5bf0b62990717b30f8322e236016b7bd71e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer?= Date: Wed, 4 Mar 2026 08:51:25 +0300 Subject: [PATCH] fix: correct content-type for HTML pages and allow password-less redis (#418) * fix: correct content-type for HTML pages and allow password-less redis Set Content-Type to 'text/html' instead of 'text' for index and error page responses, since both return HTML content. Also change redis username/password fallback from empty string to undefined so that the driver skips AUTH when no credentials are configured. An empty string causes AUTH to be sent which fails on servers with no password set. Fixes #387, fixes #388 * fix: revert unintended formatting change to pass deno fmt check Co-Authored-By: Claude Opus 4.6 (1M context) --------- Co-authored-by: Claude Opus 4.6 (1M context) --- api/index.ts | 4 ++-- src/config/cache.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/index.ts b/api/index.ts index ac51d90..48797d7 100644 --- a/api/index.ts +++ b/api/index.ts @@ -92,7 +92,7 @@ async function app(req: Request): Promise { { status: error.status, headers: new Headers({ - "Content-Type": "text", + "Content-Type": "text/html", "Cache-Control": cacheControlHeader, }), }, @@ -138,7 +138,7 @@ async function app(req: Request): Promise { { status: userResponseInfo.code, headers: new Headers({ - "Content-Type": "text", + "Content-Type": "text/html", "Cache-Control": cacheControlHeader, }), }, diff --git a/src/config/cache.ts b/src/config/cache.ts index 1828cf2..903bcbb 100644 --- a/src/config/cache.ts +++ b/src/config/cache.ts @@ -23,8 +23,8 @@ class CacheProvider { this.client = await connect({ hostname: Deno.env.get("REDIS_HOST") || "", port: Number(Deno.env.get("REDIS_PORT")) || 6379, - username: Deno.env.get("REDIS_USERNAME") || "", - password: Deno.env.get("REDIS_PASSWORD") || "", + username: Deno.env.get("REDIS_USERNAME") || undefined, + password: Deno.env.get("REDIS_PASSWORD") || undefined, }); }