fix: middleware bypass

This commit is contained in:
yusing
2025-05-11 06:33:22 +08:00
parent f1eefde964
commit 71ca8c738e
7 changed files with 294 additions and 273 deletions

View File

@@ -8,8 +8,8 @@ import (
"github.com/gobwas/glob"
"github.com/yusing/go-proxy/internal/gperr"
"github.com/yusing/go-proxy/internal/net/gphttp/reverseproxy"
"github.com/yusing/go-proxy/internal/net/types"
"github.com/yusing/go-proxy/internal/route/routes"
"github.com/yusing/go-proxy/internal/utils/strutils"
)
@@ -242,7 +242,7 @@ var checkers = map[string]struct {
builder: func(args any) CheckFunc {
route := args.(string)
return func(_ Cache, r *http.Request) bool {
return reverseproxy.TryGetUpstreamName(r) == route
return routes.TryGetUpstreamName(r) == route
}
},
},