fix sre rewrite: strip prefix before appending /api (#1358)
This commit is contained in:
@@ -89,8 +89,10 @@ function requireAdminBearer(req, res, next) {
|
||||
app.use('/api', requireApiBearer);
|
||||
|
||||
// Rewrite /api/sre/* → /api/* so the gateway can forward channel-prefixed paths.
|
||||
app.use('/api/sre', (req, res, next) => {
|
||||
req.url = req.url.replace('/api/sre', '/api');
|
||||
app.use((req, res, next) => {
|
||||
if (req.url.startsWith('/api/sre')) {
|
||||
req.url = '/api' + req.url.slice(9);
|
||||
}
|
||||
next();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user