Allow to have middleware for the path same with a HTML page

The feature was introduced with 9e2d0a7fbc,
but regressed with commit 8dc52a04e4.
This commit is contained in:
Akihiko Odaki
2019-04-13 19:34:39 +09:00
parent 7be7e1eb9f
commit 0fd332135e

View File

@@ -329,12 +329,10 @@ export function get_page_handler(
return;
}
if (!server_routes.some(route => route.pattern.test(req.path))) {
for (const page of pages) {
if (page.pattern.test(req.path)) {
handle_page(page, req, res);
return;
}
for (const page of pages) {
if (page.pattern.test(req.path)) {
handle_page(page, req, res);
return;
}
}