mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-24 17:28:31 +02:00
fix(middleware): fix route bypass matching
- replace upstream headers approach with context value
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
"github.com/gobwas/glob"
|
||||
"github.com/yusing/go-proxy/internal/gperr"
|
||||
"github.com/yusing/go-proxy/internal/net/gphttp/httpheaders"
|
||||
"github.com/yusing/go-proxy/internal/net/gphttp/reverseproxy"
|
||||
"github.com/yusing/go-proxy/internal/net/types"
|
||||
"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 r.Header.Get(httpheaders.HeaderUpstreamName) == route
|
||||
return reverseproxy.TryGetUpstreamName(r) == route
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user