diff --git a/changelog.md b/changelog.md index 5ae7d76..fef5d4b 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,14 @@ # Changelog +## 2025-09-03 - 3.0.79 - fix(servertools) +Normalize Express wildcard parameter notation to /{*splat} across server routes and handlers; add local Claude settings + +- Replaced route pattern '/*splat' with '/{*splat}' in ts/classes.typedserver.ts and ts/servertools/tools.sslredirect.ts +- Updated Express options route to use '/{*splat}' in ts/servertools/classes.server.ts +- Clarified wildcard handling comments and array-join logic for splat params in ts/servertools/classes.handlerproxy.ts and ts/servertools/classes.handlerstatic.ts +- Added .claude/settings.local.json containing local tool permissions for Claude/dev onboarding +- No functional API changes — routing pattern normalization and comment/handler improvements only + ## 2025-09-03 - 3.0.78 - fix(servertools) Fix wildcard path extraction for static/proxy handlers, correct serviceworker route, add local settings and test typo fix diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 32d3695..34c5f9c 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@api.global/typedserver', - version: '3.0.78', + version: '3.0.79', description: 'A TypeScript-based project for easy serving of static files with support for live reloading, compression, and typed requests.' } diff --git a/ts/classes.typedserver.ts b/ts/classes.typedserver.ts index b468296..751077d 100644 --- a/ts/classes.typedserver.ts +++ b/ts/classes.typedserver.ts @@ -146,7 +146,7 @@ export class TypedServer { if (this.options.serveDir) { this.server.addRoute( - '/*splat', + '/{*splat}', new servertools.HandlerStatic(this.options.serveDir, { responseModifier: async (responseArg) => { if (plugins.path.parse(responseArg.path).ext === '.html') { diff --git a/ts/servertools/classes.handlerproxy.ts b/ts/servertools/classes.handlerproxy.ts index 8de0103..26d8928 100644 --- a/ts/servertools/classes.handlerproxy.ts +++ b/ts/servertools/classes.handlerproxy.ts @@ -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) { diff --git a/ts/servertools/classes.handlerstatic.ts b/ts/servertools/classes.handlerstatic.ts index cef9d3c..112776f 100644 --- a/ts/servertools/classes.handlerstatic.ts +++ b/ts/servertools/classes.handlerstatic.ts @@ -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) { diff --git a/ts/servertools/classes.server.ts b/ts/servertools/classes.server.ts index 32c4079..49136cb 100644 --- a/ts/servertools/classes.server.ts +++ b/ts/servertools/classes.server.ts @@ -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) => { diff --git a/ts/servertools/tools.sslredirect.ts b/ts/servertools/tools.sslredirect.ts index b2625cc..9be6113 100644 --- a/ts/servertools/tools.sslredirect.ts +++ b/ts/servertools/tools.sslredirect.ts @@ -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); })