Skip to content

Commit 611e5bf

Browse files
omerarslan0claude
andauthored
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) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 192693f commit 611e5bf

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

api/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ async function app(req: Request): Promise<Response> {
9292
{
9393
status: error.status,
9494
headers: new Headers({
95-
"Content-Type": "text",
95+
"Content-Type": "text/html",
9696
"Cache-Control": cacheControlHeader,
9797
}),
9898
},
@@ -138,7 +138,7 @@ async function app(req: Request): Promise<Response> {
138138
{
139139
status: userResponseInfo.code,
140140
headers: new Headers({
141-
"Content-Type": "text",
141+
"Content-Type": "text/html",
142142
"Cache-Control": cacheControlHeader,
143143
}),
144144
},

src/config/cache.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ class CacheProvider {
2323
this.client = await connect({
2424
hostname: Deno.env.get("REDIS_HOST") || "",
2525
port: Number(Deno.env.get("REDIS_PORT")) || 6379,
26-
username: Deno.env.get("REDIS_USERNAME") || "",
27-
password: Deno.env.get("REDIS_PASSWORD") || "",
26+
username: Deno.env.get("REDIS_USERNAME") || undefined,
27+
password: Deno.env.get("REDIS_PASSWORD") || undefined,
2828
});
2929
}
3030

0 commit comments

Comments
 (0)