mirror of
https://github.com/juanfont/headscale.git
synced 2026-10-27 16:56:49 +09:00
mapper: stop shadowing predeclared cap
golangci-lint 2.15 predeclared check flags it.
This commit is contained in:
1 parent
123dcd9df4
commit
79ae38f0af
1 file changed
+4
-4
@@ -174,19 +174,19 @@ func nextDNSProfileFromCapMap(capMap tailcfg.NodeCapMap) string {
|
||||
|
||||
candidates := make([]string, 0, len(capMap))
|
||||
|
||||
for cap := range capMap {
|
||||
if cap == nextDNSAttrNoInfo {
|
||||
for attr := range capMap {
|
||||
if attr == nextDNSAttrNoInfo {
|
||||
continue
|
||||
}
|
||||
|
||||
profile, ok := strings.CutPrefix(string(cap), nextDNSAttrPrefix)
|
||||
profile, ok := strings.CutPrefix(string(attr), nextDNSAttrPrefix)
|
||||
if !ok || profile == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
if !nextDNSProfileRE.MatchString(profile) {
|
||||
log.Warn().
|
||||
Str("cap", string(cap)).
|
||||
Str("cap", string(attr)).
|
||||
Msg("nextdns profile rejected: must match [A-Za-z0-9._-]{1,64}")
|
||||
|
||||
continue
|
||||
|
||||
Reference in new issue
Block a user