mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-09-27 03:56:51 +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},
|
||||
|
@@ -30,7 +30,10 @@ func buildRouter() *router.Router {
|
||||
r := router.New(config.PathPrefix)
|
||||
|
||||
r.GET("/", handleLanding, true)
|
||||
r.GET("", handleLanding, true)
|
||||
|
||||
r.GET("/", withMetrics(withPanicHandler(withCORS(withSecret(handleProcessing)))), false)
|
||||
|
||||
r.HEAD("/", withCORS(handleHead), false)
|
||||
r.OPTIONS("/", withCORS(handleHead), false)
|
||||
|
||||
|
Reference in New Issue
Block a user