-
-
Notifications
You must be signed in to change notification settings - Fork 101
Closed
Description
Currently, if you create an endpoint handler and set checkPath to false the endpoint code will never be called.
var fooHandler = zap.Middleware.EndpointHandler(Handler, Context).init(
fooEndpoint.endpoint(),
null,
.{
.checkPath = false,
},
);This seems to be caused by the logic in EndpointHandler.onRequest.
As self.endpoint.onRequest(r) is only called inside this if, and if checkPath is false it will always skip endpoint, instead of always running the enpoint.
if (self.options.checkPath and
std.mem.startsWith(u8, r.path orelse "", self.endpoint.settings.path))
{
self.endpoint.onRequest(r);
}Reverting 9a80747 should fix the issue.
Metadata
Metadata
Assignees
Labels
No labels