mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
framework: fix pathToRegexp
This commit is contained in:
2 files changed
+3
-2
No files matched your search
@@ -15,7 +15,7 @@ export class WebSocketLayer {
|
|||||||
regexp: RegExp;
|
regexp: RegExp;
|
||||||
|
|
||||||
constructor(path: Parameters<typeof pathToRegexp>[0], public callback?: WebSocketCallback) {
|
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) {
|
accept(socket: WebSocket, request: IncomingMessage, ctx: KoaContext) {
|
||||||
|
|||||||
@@ -481,7 +481,7 @@ ${c.response.status} ${endTime - startTime}ms ${c.response.length}`);
|
|||||||
|
|
||||||
const name = HandlerClass.name.replace(/Handler$/, '');
|
const name = HandlerClass.name.replace(/Handler$/, '');
|
||||||
const steps = [
|
const steps = [
|
||||||
'init', 'handler/init',
|
'log/__init', 'init', 'handler/init',
|
||||||
`handler/before-prepare/${name}#${method}`, `handler/before-prepare/${name}`, 'handler/before-prepare',
|
`handler/before-prepare/${name}#${method}`, `handler/before-prepare/${name}`, 'handler/before-prepare',
|
||||||
'log/__prepare', '__prepare', '_prepare', 'prepare', 'log/__prepareDone',
|
'log/__prepare', '__prepare', '_prepare', 'prepare', 'log/__prepareDone',
|
||||||
`handler/before/${name}#${method}`, `handler/before/${name}`, 'handler/before',
|
`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',
|
`handler/after/${name}#${method}`, `handler/after/${name}`, 'handler/after',
|
||||||
'cleanup',
|
'cleanup',
|
||||||
`handler/finish/${name}#${method}`, `handler/finish/${name}`, 'handler/finish',
|
`handler/finish/${name}#${method}`, `handler/finish/${name}`, 'handler/finish',
|
||||||
|
'log/__finish',
|
||||||
];
|
];
|
||||||
|
|
||||||
let current = 0;
|
let current = 0;
|
||||||
|
|||||||
Reference in new issue
Block a user