fileName now take the upload code
This commit is contained in:
@@ -2,7 +2,7 @@ import { lstat } from "node:fs/promises";
|
||||
import { hasValidAuth, renderPasswordForm } from "../auth";
|
||||
import { notFound } from "../http";
|
||||
import { log } from "../log";
|
||||
import { contentDisposition, fileIdFromKey, KEY_PATTERN, secretMatches } from "../security";
|
||||
import { contentDisposition, downloadFileName, fileIdFromKey, KEY_PATTERN, secretMatches } from "../security";
|
||||
import { isExpired, type Storage } from "../storage";
|
||||
|
||||
export async function handleDownload(
|
||||
@@ -41,7 +41,7 @@ export async function handleDownload(
|
||||
const headers = new Headers({
|
||||
"content-type": meta.mimeType || "application/octet-stream",
|
||||
"content-length": String(fileStat.size),
|
||||
"content-disposition": contentDisposition(meta.originalName),
|
||||
"content-disposition": contentDisposition(downloadFileName(rawKey, meta.originalName)),
|
||||
"cache-control": "private, no-store",
|
||||
"x-content-type-options": "nosniff",
|
||||
"referrer-policy": "no-referrer",
|
||||
|
||||
Reference in New Issue
Block a user