update
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user