aboutsummaryrefslogtreecommitdiff
path: root/middleware/file/wildcard.go
blob: 9526cb53f7c3582515b114cec7319023f092ccd8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
package file

import "github.com/miekg/dns"

// replaceWithWildcard replaces the left most label with '*'.
func replaceWithAsteriskLabel(qname string) (wildcard string) {
	i, shot := dns.NextLabel(qname, 0)
	if shot {
		return ""
	}

	return "*." + qname[i:]
}