diff --git a/package.json b/package.json index 960b371..e91dba4 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,10 @@ "key": "page-proxy", "entry": "dist/app.js", "type": "pm2-system-app", + "runtime": [ + "client", + "server" + ], "files": [ "dist" ] diff --git a/src/module/proxy/ai-proxy.ts b/src/module/proxy/ai-proxy.ts index fdcb949..62e43b2 100644 --- a/src/module/proxy/ai-proxy.ts +++ b/src/module/proxy/ai-proxy.ts @@ -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;