This commit is contained in:
2026-01-17 20:19:07 +08:00
parent 2cb12644ea
commit 5395449751
5 changed files with 34 additions and 93 deletions

View File

@@ -123,10 +123,18 @@ export const proxyRoute = async (req: http.IncomingMessage, res: http.ServerResp
// res.setHeader('Access-Control-Allow-Origin', '*');
// res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
// res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization, X-Requested-With');
if (apiBackendProxy.s3?.id) {
const storage = _assistantConfig?.storage || []
const storageConfig = storage.find((item) => item.id === apiBackendProxy.s3?.id);
apiBackendProxy.s3 = {
...storageConfig,
...apiBackendProxy.s3,
}
}
return proxy(req, res, {
path: apiBackendProxy.path,
target: apiBackendProxy.target,
...apiBackendProxy
...apiBackendProxy,
});
}
logger.debug('proxyRoute handle by router', { url: req.url }, noAdmin);