fix(servertools): Adjust route wildcard patterns and CORS handling; update serviceworker and SSL redirect patterns; bump express dependency; add local Claude settings

This commit is contained in:
2025-08-17 12:49:28 +00:00
parent 9477eac268
commit a0f714a561
9 changed files with 19 additions and 9 deletions

View File

@@ -1,5 +1,15 @@
# Changelog
## 2025-08-17 - 3.0.77 - fix(servertools)
Adjust route wildcard patterns and CORS handling; update serviceworker and SSL redirect patterns; bump express dependency; add local Claude settings
- Normalize route wildcard patterns to use splat tokens (e.g. '/someroute/*' -> '/someroute/*splat', '/*' -> '/*splat') for consistent route matching
- Update serviceworker route registration to '/serviceworker{.*}' and adjust related handler
- Change SSL redirect route from '*' to '/*splat'
- Adjust CORS preflight options path to '/*splat' and update tests to reflect new route patterns
- Bump express dependency from ^4.21.2 to ^5.1.0
- Add .claude/settings.local.json for local Claude tool permissions
## 2025-08-16 - 3.0.76 - fix(handlerproxy)
Use SmartRequest API and improve proxy/asset response handling; update tests and bump dependencies; add local project configuration files

View File

@@ -92,7 +92,7 @@
"@types/express": "^5.0.3",
"body-parser": "^2.2.0",
"cors": "^2.8.5",
"express": "^4.21.2",
"express": "^5.1.0",
"express-force-ssl": "^0.3.2",
"lit": "^3.3.1"
},

4
pnpm-lock.yaml generated
View File

@@ -111,8 +111,8 @@ importers:
specifier: ^2.8.5
version: 2.8.5
express:
specifier: ^4.21.2
version: 4.21.2
specifier: ^5.1.0
version: 5.1.0
express-force-ssl:
specifier: ^0.3.2
version: 0.3.2

View File

@@ -48,7 +48,7 @@ tap.test('should create a valid Server', async () => {
tap.test('should create a valid Route', async () => {
testRoute = testServer.addRoute('/someroute');
testRoute2 = testServer.addRoute('/someroute/*');
testRoute2 = testServer.addRoute('/someroute/*splat');
expect(testRoute).toBeInstanceOf(typedserver.servertools.Route);
});

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@api.global/typedserver',
version: '3.0.76',
version: '3.0.77',
description: 'A TypeScript-based project for easy serving of static files with support for live reloading, compression, and typed requests.'
}

View File

@@ -146,7 +146,7 @@ export class TypedServer {
if (this.options.serveDir) {
this.server.addRoute(
'/*',
'/*splat',
new servertools.HandlerStatic(this.options.serveDir, {
responseModifier: async (responseArg) => {
if (plugins.path.parse(responseArg.path).ext === '.html') {

View File

@@ -132,7 +132,7 @@ export class Server {
});
this.expressAppInstance.use(cors);
this.expressAppInstance.options('/*', cors);
this.expressAppInstance.options('/*splat', cors);
}
this.expressAppInstance.use((req, res, next) => {

View File

@@ -38,7 +38,7 @@ export const addServiceWorkerRoute = (
swVersionInfo = swDataFunc();
// the basic stuff
typedserverInstance.server.addRoute('/serviceworker.*', serviceworkerHandler);
typedserverInstance.server.addRoute('/serviceworker{.*}', serviceworkerHandler);
// the typed stuff
const typedrouter = new plugins.typedrequest.TypedRouter();

View File

@@ -10,7 +10,7 @@ export const redirectFrom80To443 = async () => {
});
smartexpressInstance.addRoute(
'*',
'/*splat',
new Handler('ALL', async (req, res) => {
res.redirect('https://' + req.headers.host + req.url);
})