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:
10
changelog.md
10
changelog.md
@@ -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
|
||||
|
||||
|
@@ -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
4
pnpm-lock.yaml
generated
@@ -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
|
||||
|
@@ -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);
|
||||
});
|
||||
|
||||
|
@@ -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.'
|
||||
}
|
||||
|
@@ -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') {
|
||||
|
@@ -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) => {
|
||||
|
@@ -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();
|
||||
|
@@ -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);
|
||||
})
|
||||
|
Reference in New Issue
Block a user