fix(route): allow excluded routes to use localhost addresses

Routes marked for exclusion should bypass normal validation checks,
including the restriction on localhost/127.0.0.1 hostnames.
This commit is contained in:
yusing
2026-01-31 18:51:15 +08:00
parent c0e2cf63b5
commit 95f88a6f3c

View File

@@ -254,7 +254,7 @@ func (r *Route) validate() gperr.Error {
}
// return error if route is localhost:<godoxy_port> but route is not agent
if !r.IsAgent() {
if !r.IsAgent() && !r.ShouldExclude() {
switch r.Host {
case "localhost", "127.0.0.1":
switch r.Port.Proxy {