From 20015d661386b61253a0ee5e4e6ebb86f6c7578c Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Tue, 17 Jul 2018 17:27:48 -0400 Subject: [PATCH] oops --- src/middleware.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/middleware.ts b/src/middleware.ts index 3badc7f..577b9fd 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -251,7 +251,7 @@ function get_page_handler(routes: RouteObject, store_getter: (req: Req) => Store function handle_page(page: Page, req: Req, res: ServerResponse, status = 200, error: Error | string = null) { const get_params = page.parts[page.parts.length - 1].params || (() => ({})); - const match = page.pattern.exec(req.path); + const match = error ? null : page.pattern.exec(req.path); req.params = error ? {}