Skip to content

Commit ecae77a

Browse files
feat: update doc comments
1 parent 6b662df commit ecae77a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

rulesengine/engine.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ func (re *Engine) matches(r Rule, method, url string) bool {
7777

7878
if r.HostPattern != nil {
7979
// For a host pattern to match, every label has to match or be an `*`.
80-
// Subdomains also match automatically, meaning if the pattern is "example.com"
81-
// and the real is "api.example.com", it should match. We check this by comparing
82-
// from the end of the actual hostname with the pattern (which is in normal order).
80+
// Host matching is strict:
81+
// - "github.com" matches ONLY "github.com" (exact match, no subdomains)
82+
// - "*.github.com" matches ONLY subdomains like "api.github.com" (not the base domain)
83+
// - To allow both, specify: "github.com, *.github.com"
8384

8485
labels := strings.Split(parsedUrl.Hostname(), ".")
8586

0 commit comments

Comments
 (0)