fix(servertools): Normalize Express wildcard parameter notation to /{*splat} across server routes and handlers; add local Claude settings
This commit is contained in:
@@ -19,7 +19,7 @@ export class HandlerProxy extends Handler {
|
||||
// Extract the path using Express 5's params or fallback methods
|
||||
let relativeRequestPath: string;
|
||||
if (req.params && req.params.splat !== undefined) {
|
||||
// Express 5 wildcard route (/*splat)
|
||||
// Express 5 wildcard route (/*splat or /{*splat})
|
||||
// Handle array values - join them if array, otherwise use as-is
|
||||
relativeRequestPath = Array.isArray(req.params.splat) ? req.params.splat.join('/') : String(req.params.splat || '');
|
||||
} else if (req.params && req.params[0] !== undefined) {
|
||||
|
@@ -39,7 +39,7 @@ export class HandlerStatic extends Handler {
|
||||
// Extract the path using Express 5's params or fallback methods
|
||||
let filePath: string;
|
||||
if (req.params && req.params.splat !== undefined) {
|
||||
// Express 5 wildcard route (/*splat)
|
||||
// Express 5 wildcard route (/*splat or /{*splat})
|
||||
// Handle array values - join them if array, otherwise use as-is
|
||||
filePath = Array.isArray(req.params.splat) ? req.params.splat.join('/') : String(req.params.splat || '');
|
||||
} else if (req.params && req.params[0] !== undefined) {
|
||||
|
@@ -132,7 +132,7 @@ export class Server {
|
||||
});
|
||||
|
||||
this.expressAppInstance.use(cors);
|
||||
this.expressAppInstance.options('/*splat', cors);
|
||||
this.expressAppInstance.options('/{*splat}', cors);
|
||||
}
|
||||
|
||||
this.expressAppInstance.use((req, res, next) => {
|
||||
|
@@ -10,7 +10,7 @@ export const redirectFrom80To443 = async () => {
|
||||
});
|
||||
|
||||
smartexpressInstance.addRoute(
|
||||
'/*splat',
|
||||
'/{*splat}',
|
||||
new Handler('ALL', async (req, res) => {
|
||||
res.redirect('https://' + req.headers.host + req.url);
|
||||
})
|
||||
|
Reference in New Issue
Block a user