From 4649021978354fbe570c14f6782f160561404494 Mon Sep 17 00:00:00 2001 From: Madeorsk Date: Fri, 18 Oct 2024 15:09:11 +0200 Subject: [PATCH] Correctly add pre handlers and post handlers to routes nodes. --- src/route.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/route.zig b/src/route.zig index 815c0ef..0ece35b 100644 --- a/src/route.zig +++ b/src/route.zig @@ -195,6 +195,8 @@ pub const RouteNode = struct { .handle = definition.handle, .handleNotFound = definition.handleNotFound, .handleError = definition.handleError, + .preHandle = definition.preHandle, + .postHandle = definition.postHandle, }); } else @@ -203,6 +205,8 @@ pub const RouteNode = struct { childTree.handle = definition.handle; childTree.handleNotFound = definition.handleNotFound; childTree.handleError = definition.handleError; + childTree.preHandle = definition.preHandle; + childTree.postHandle = definition.postHandle; if (definition.children) |children| { // If there are children, recursively parse them.