From 9543ede15fc9ad038ec4839628c886b124580983 Mon Sep 17 00:00:00 2001 From: Rene Schallner Date: Mon, 14 Oct 2024 23:18:19 +0200 Subject: [PATCH] EndpointHandler: de-morgan logic for useRoutes from !a or b -> a and b --- src/middleware.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/middleware.zig b/src/middleware.zig index c094fee..3fa734c 100644 --- a/src/middleware.zig +++ b/src/middleware.zig @@ -99,7 +99,7 @@ pub fn EndpointHandler(comptime HandlerType: anytype, comptime ContextType: anyt pub fn onRequest(handler: *HandlerType, r: zap.Request, context: *ContextType) bool { const self: *Self = @fieldParentPtr("handler", handler); r.setUserContext(context); - if (!self.options.checkPath or + if (self.options.checkPath and std.mem.startsWith(u8, r.path orelse "", self.endpoint.settings.path)) { self.endpoint.onRequest(r);