changing path
This commit is contained in:
+3
-3
@@ -19,7 +19,7 @@ export async function handleAuth(
|
||||
if (!meta) return notFound();
|
||||
|
||||
if (!meta.passwordHash) {
|
||||
return new Response(null, { status: 302, headers: { location: `/d/${rawKey}` } });
|
||||
return new Response(null, { status: 302, headers: { location: `/${rawKey}` } });
|
||||
}
|
||||
|
||||
const password = await req.formData().then(
|
||||
@@ -32,7 +32,7 @@ export async function handleAuth(
|
||||
|
||||
if (!passwordMatches(meta.passwordHash, password)) {
|
||||
log("warn", `auth failed id=${id}`);
|
||||
return new Response(null, { status: 302, headers: { location: `/d/${rawKey}?e=1` } });
|
||||
return new Response(null, { status: 302, headers: { location: `/${rawKey}?e=1` } });
|
||||
}
|
||||
|
||||
const token = makeAuthToken(rawKey, secret, AUTH_TTL_MS);
|
||||
@@ -41,5 +41,5 @@ export async function handleAuth(
|
||||
}; Max-Age=${Math.floor(AUTH_TTL_MS / 1000)}`;
|
||||
|
||||
log("info", `auth ok id=${id}`);
|
||||
return new Response(null, { status: 302, headers: { location: `/d/${rawKey}`, "set-cookie": cookie } });
|
||||
return new Response(null, { status: 302, headers: { location: `/${rawKey}`, "set-cookie": cookie } });
|
||||
}
|
||||
@@ -76,7 +76,7 @@ export async function handleUpload(
|
||||
});
|
||||
|
||||
log("info", `upload ok id=${id} size=${size} name=${JSON.stringify(originalName)}`);
|
||||
return json({ id, key, url: `/d/${key}`, originalName, size, protected: true });
|
||||
return json({ id, key, url: `/${key}`, originalName, size, protected: true });
|
||||
} catch (err) {
|
||||
await storage.delete(id);
|
||||
await storage.deletePartial(id);
|
||||
|
||||
Reference in New Issue
Block a user