Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(router): not obtain middleware in RouteInfo #3794

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thoohv5
Copy link

@thoohv5 thoohv5 commented Dec 7, 2023

gin.RoutesInfo not provide function to obtain all handlerFunc.

diff --git a/gin.go b/gin.go
index 5a605cf143..99a4e58d23 100644
--- a/gin.go
+++ b/gin.go
@@ -63,6 +63,7 @@ type RouteInfo struct {
 	Method      string
 	Path        string
 	Handler     string
+	Handlers    HandlersChain
 	HandlerFunc HandlerFunc
 }
 
@@ -360,6 +361,7 @@ func iterate(path, method string, routes RoutesInfo, root *node) RoutesInfo {
 			Method:      method,
 			Path:        path,
 			Handler:     nameOfFunction(handlerFunc),
+			Handlers:    root.handlers,
 			HandlerFunc: handlerFunc,
 		})
 	}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant