mirror of
https://github.com/reiyua/github-profile-trophy-reiyua-mirror.git
synced 2026-11-17 06:02:09 +11:00
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>
This commit is contained in:
parent
192693fe27
commit
611e5bf0b6
2 changed files with 4 additions and 4 deletions
|
|
@ -92,7 +92,7 @@ async function app(req: Request): Promise<Response> {
|
||||||
{
|
{
|
||||||
status: error.status,
|
status: error.status,
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
"Content-Type": "text",
|
"Content-Type": "text/html",
|
||||||
"Cache-Control": cacheControlHeader,
|
"Cache-Control": cacheControlHeader,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
|
@ -138,7 +138,7 @@ async function app(req: Request): Promise<Response> {
|
||||||
{
|
{
|
||||||
status: userResponseInfo.code,
|
status: userResponseInfo.code,
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
"Content-Type": "text",
|
"Content-Type": "text/html",
|
||||||
"Cache-Control": cacheControlHeader,
|
"Cache-Control": cacheControlHeader,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ class CacheProvider {
|
||||||
this.client = await connect({
|
this.client = await connect({
|
||||||
hostname: Deno.env.get("REDIS_HOST") || "",
|
hostname: Deno.env.get("REDIS_HOST") || "",
|
||||||
port: Number(Deno.env.get("REDIS_PORT")) || 6379,
|
port: Number(Deno.env.get("REDIS_PORT")) || 6379,
|
||||||
username: Deno.env.get("REDIS_USERNAME") || "",
|
username: Deno.env.get("REDIS_USERNAME") || undefined,
|
||||||
password: Deno.env.get("REDIS_PASSWORD") || "",
|
password: Deno.env.get("REDIS_PASSWORD") || undefined,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue