framework: fix pathToRegexp

This commit is contained in:
undefined committed 2024-09-26 07:08:21 +08:00
1 parent 7ccc119e33
commit 4afc4e0dfe
2 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -15,7 +15,7 @@ export class WebSocketLayer {
regexp: RegExp;
constructor(path: Parameters<typeof pathToRegexp>[0], public callback?: WebSocketCallback) {
this.regexp = pathToRegexp(path);
this.regexp = pathToRegexp(path).regexp;
}
accept(socket: WebSocket, request: IncomingMessage, ctx: KoaContext) {
+2 -1
View File
@@ -481,7 +481,7 @@ ${c.response.status} ${endTime - startTime}ms ${c.response.length}`);
const name = HandlerClass.name.replace(/Handler$/, '');
const steps = [
'init', 'handler/init',
'log/__init', 'init', 'handler/init',
`handler/before-prepare/${name}#${method}`, `handler/before-prepare/${name}`, 'handler/before-prepare',
'log/__prepare', '__prepare', '_prepare', 'prepare', 'log/__prepareDone',
`handler/before/${name}#${method}`, `handler/before/${name}`, 'handler/before',
@@ -493,6 +493,7 @@ ${c.response.status} ${endTime - startTime}ms ${c.response.length}`);
`handler/after/${name}#${method}`, `handler/after/${name}`, 'handler/after',
'cleanup',
`handler/finish/${name}#${method}`, `handler/finish/${name}`, 'handler/finish',
'log/__finish',
];
let current = 0;