fix sre rewrite: strip prefix before appending /api (#1358)

This commit is contained in:
NotSoToothless
2026-06-28 06:31:54 -07:00
committed by GitHub
parent ffb31f3bb1
commit c1acafe65a
+4 -2
View File
@@ -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();
});