更新依赖项,优化 WebSocket 处理,添加文件流管道功能,改进用户认证逻辑
This commit is contained in:
@@ -10,7 +10,7 @@ import { addStat } from '@/modules/html/stat/index.ts';
|
||||
import path from 'path';
|
||||
import { getTextContentType } from '@/modules/fm-manager/index.ts';
|
||||
import { logger } from '@/modules/logger.ts';
|
||||
|
||||
import { pipeStream } from '../pipe.ts';
|
||||
const pipelineAsync = promisify(pipeline);
|
||||
|
||||
export async function downloadFileFromMinio(fileUrl: string, destFile: string) {
|
||||
@@ -74,7 +74,7 @@ export async function minioProxy(
|
||||
res.writeHead(200, {
|
||||
...headers,
|
||||
});
|
||||
objectStream.pipe(res, { end: true });
|
||||
pipeStream(objectStream as any, res);
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
@@ -154,7 +154,7 @@ export const httpProxy = async (
|
||||
res.writeHead(proxyRes.statusCode, {
|
||||
...headers,
|
||||
});
|
||||
proxyRes.pipe(res, { end: true });
|
||||
pipeStream(proxyRes as any, res);
|
||||
}
|
||||
});
|
||||
proxyReq.on('error', (err) => {
|
||||
|
||||
Reference in New Issue
Block a user