fix: remove x-file-name for ZHONGWEN 错误
This commit is contained in:
parent
4d39b22bdd
commit
a9f0170775
@ -9,6 +9,10 @@
|
|||||||
"key": "page-proxy",
|
"key": "page-proxy",
|
||||||
"entry": "dist/app.js",
|
"entry": "dist/app.js",
|
||||||
"type": "pm2-system-app",
|
"type": "pm2-system-app",
|
||||||
|
"runtime": [
|
||||||
|
"client",
|
||||||
|
"server"
|
||||||
|
],
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
]
|
]
|
||||||
|
@ -75,14 +75,12 @@ const getAiProxy = async (req: IncomingMessage, res: ServerResponse, opts: Proxy
|
|||||||
const contentLength = stat.size;
|
const contentLength = stat.size;
|
||||||
const etag = stat.etag;
|
const etag = stat.etag;
|
||||||
const lastModified = stat.lastModified.toISOString();
|
const lastModified = stat.lastModified.toISOString();
|
||||||
const fileName = objectName.split('/').pop();
|
|
||||||
|
|
||||||
const objectStream = await minioClient.getObject(bucketName, objectName);
|
const objectStream = await minioClient.getObject(bucketName, objectName);
|
||||||
const headers = {
|
const headers = {
|
||||||
'Content-Length': contentLength,
|
'Content-Length': contentLength,
|
||||||
etag,
|
etag,
|
||||||
'last-modified': lastModified,
|
'last-modified': lastModified,
|
||||||
'x-file-name': fileName,
|
|
||||||
...filterMetaData,
|
...filterMetaData,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -194,7 +192,7 @@ export const postProxy = async (req: IncomingMessage, res: ServerResponse, opts:
|
|||||||
};
|
};
|
||||||
export const getObjectName = async (req: IncomingMessage, opts?: { checkOwner?: boolean }) => {
|
export const getObjectName = async (req: IncomingMessage, opts?: { checkOwner?: boolean }) => {
|
||||||
const _u = new URL(req.url, 'http://localhost');
|
const _u = new URL(req.url, 'http://localhost');
|
||||||
const pathname = _u.pathname;
|
const pathname = decodeURIComponent(_u.pathname);
|
||||||
const params = _u.searchParams;
|
const params = _u.searchParams;
|
||||||
const { user, app } = getUserFromRequest(req);
|
const { user, app } = getUserFromRequest(req);
|
||||||
const checkOwner = opts?.checkOwner ?? true;
|
const checkOwner = opts?.checkOwner ?? true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user