Skip to content

Commit

Permalink
Merge branch 'master' into fix-ci-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gaby authored Jul 19, 2024
2 parents 6fb6497 + 02be81e commit 46d8b83
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions forwardproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,18 @@ func (h Handler) dialContextCheckACL(ctx context.Context, network, hostPort stri
fmt.Errorf("port %s is not allowed", port))
}

match:
for _, rule := range h.aclRules {
if _, ok := rule.(*aclDomainRule); ok {
switch rule.tryMatch(nil, host) {
case aclDecisionDeny:
return nil, caddyhttp.Error(http.StatusForbidden, fmt.Errorf("disallowed host %s", host))
case aclDecisionAllow:
break match
}
}
}

// in case IP was provided, net.LookupIP will simply return it
IPs, err := net.LookupIP(host)
if err != nil {
Expand Down

0 comments on commit 46d8b83

Please sign in to comment.