fix(enka): include query params in redirect cacheKey
Build and Deploy / build-and-deploy (push) Successful in 1m10s

This commit is contained in:
2026-07-10 11:48:13 +07:00 Unverified
parent ebf0a73713
commit d4ae8873ff
+16 -1
View File
@@ -489,7 +489,22 @@ export function card(app: App) {
async ({ params: { username }, query }) => {
const errorLoc = cardErrorLocs[query.lang === "th" ? "th" : "en"];
try {
const cacheKey = `enka-redir::${username}`;
const cacheKey = `enka-redir::${username}::${hash(
JSON.stringify(
Object.entries(query).filter(([key]) =>
[
"error",
"lang",
"debug",
"format",
"quality",
"h",
"w",
"substat",
].includes(key),
),
),
).toString(36)}`;
if (feature("API")) {
const cached = cache.get<Response>(cacheKey);
if (cached) return cached.clone();