fix: remove x-file-name for ZHONGWEN 错误

This commit is contained in:
熊潇 2025-05-25 00:03:39 +08:00
parent 4d39b22bdd
commit a9f0170775
2 changed files with 5 additions and 3 deletions

View File

@ -9,6 +9,10 @@
"key": "page-proxy",
"entry": "dist/app.js",
"type": "pm2-system-app",
"runtime": [
"client",
"server"
],
"files": [
"dist"
]

View File

@ -75,14 +75,12 @@ const getAiProxy = async (req: IncomingMessage, res: ServerResponse, opts: Proxy
const contentLength = stat.size;
const etag = stat.etag;
const lastModified = stat.lastModified.toISOString();
const fileName = objectName.split('/').pop();
const objectStream = await minioClient.getObject(bucketName, objectName);
const headers = {
'Content-Length': contentLength,
etag,
'last-modified': lastModified,
'x-file-name': fileName,
...filterMetaData,
};
@ -194,7 +192,7 @@ export const postProxy = async (req: IncomingMessage, res: ServerResponse, opts:
};
export const getObjectName = async (req: IncomingMessage, opts?: { checkOwner?: boolean }) => {
const _u = new URL(req.url, 'http://localhost');
const pathname = _u.pathname;
const pathname = decodeURIComponent(_u.pathname);
const params = _u.searchParams;
const { user, app } = getUserFromRequest(req);
const checkOwner = opts?.checkOwner ?? true;