Skip to content

Commit

Permalink
EndpointHandler: de-morgan logic for useRoutes
Browse files Browse the repository at this point in the history
from !a or b -> a and b
  • Loading branch information
renerocksai committed Oct 14, 2024
1 parent 9a80747 commit 9543ede
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/middleware.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9543ede

Please sign in to comment.