You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the middleware doesn't trigger, or triggers when it shouldn't.
I register routes for a generic class, so that i have some default endpoints per type.
For some types i want to be able to modify these default endpoints and tried to do this via middleware.
When using Use() on IRoute or even RouterGroup objects, it breaks when being added after its respective ginengine.post calls.
They won't trigger at all, or trigger for the wrong route
Expectations
I can add HandlerFuncs to any IRoute at any time in the code and it gets executed before the handlerFunc provided by the ginEngine.POST/GET/... calls
Actual result
Registering Handler Funcs directly to the return value of ginEngine.POST/GET/... calls registers the Handler in some random handlers but not the desired Route
Environment
go version: 1.23.3
gin version (or commit ref): 1.10.0
operating system: Windows
The text was updated successfully, but these errors were encountered:
Yes, but this shouldn't be like that.
Router get handeld later, so order of registration should not Matter.
Also adding in Middleware after the handlers leads to undefined behavior which is also odd
Description
When creating a IRoute with middleware like this
the middleware doesn't trigger, or triggers when it shouldn't.
I register routes for a generic class, so that i have some default endpoints per type.
For some types i want to be able to modify these default endpoints and tried to do this via middleware.
When using Use() on IRoute or even RouterGroup objects, it breaks when being added after its respective ginengine.post calls.
They won't trigger at all, or trigger for the wrong route
Expectations
I can add HandlerFuncs to any IRoute at any time in the code and it gets executed before the handlerFunc provided by the ginEngine.POST/GET/... calls
Actual result
Registering Handler Funcs directly to the return value of ginEngine.POST/GET/... calls registers the Handler in some random handlers but not the desired Route
Environment
The text was updated successfully, but these errors were encountered: