Skip to content

Commit

Permalink
fix(router): fix some minor consistency issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mookums committed Nov 13, 2024
1 parent f1fbdf1 commit 9ae7696
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/http/router.zig
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ pub fn Router(comptime Server: type) type {
}

pub fn serve_not_found(self: *Self, route: Route) void {
assert(!self.locked);
self.not_found_route = route;
}

Expand All @@ -299,7 +300,7 @@ pub fn Router(comptime Server: type) type {
queries.clearRetainingCapacity();
if (self.not_found_route) |not_found| {
return FoundRoute{ .route = not_found, .captures = captures[0..0], .queries = queries };
} else return FoundRoute{ .route = base_404_route, .captures = captures[0..], .queries = queries };
} else return FoundRoute{ .route = base_404_route, .captures = captures[0..0], .queries = queries };
};
}
};
Expand Down

0 comments on commit 9ae7696

Please sign in to comment.