mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-10 04:02:29 +02:00
Fix landing when non-empty path prefix is set
This commit is contained in:
@@ -65,6 +65,11 @@ func New(prefix string) *Router {
|
||||
}
|
||||
|
||||
func (r *Router) Add(method, prefix string, handler RouteHandler, exact bool) {
|
||||
// Don't add routes with empty prefix
|
||||
if len(r.prefix+prefix) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
r.Routes = append(
|
||||
r.Routes,
|
||||
&route{Method: method, Prefix: r.prefix + prefix, Handler: handler, Exact: exact},
|
||||
|
Reference in New Issue
Block a user