v0.0.230
This commit is contained in:
@@ -143,13 +143,24 @@ func (w *GinRouteBuilder) Handle(handler WHandlerFunc) {
|
||||
}
|
||||
|
||||
func (w *GinWrapper) NoRoute(handler WHandlerFunc) {
|
||||
w.engine.NoRoute(Wrap(w, handler))
|
||||
|
||||
handlers := make([]gin.HandlerFunc, 0)
|
||||
|
||||
if w.bufferBody {
|
||||
handlers = append(handlers, BodyBuffer)
|
||||
}
|
||||
handlers = append(handlers, Wrap(w, handler))
|
||||
|
||||
middlewareNames := langext.ArrMap(handlers, func(v gin.HandlerFunc) string { return nameOfFunction(v) })
|
||||
handlerName := nameOfFunction(handler)
|
||||
|
||||
w.engine.NoRoute(handlers...)
|
||||
|
||||
w.routeSpecs = append(w.routeSpecs, ginRouteSpec{
|
||||
Method: "ANY",
|
||||
URL: "[NO_ROUTE]",
|
||||
Middlewares: nil,
|
||||
Handler: nameOfFunction(handler),
|
||||
Middlewares: middlewareNames,
|
||||
Handler: handlerName,
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user