1
0
mirror of https://github.com/juanfont/headscale.git synced 2025-09-25 17:51:11 +02:00

chore(derp): allow nil regions in DERPMaps

Previously, nil regions were not properly handled. This change allows users to disable regions in DERPMaps.

Particularly useful to disable some official regions.
This commit is contained in:
Andrey Bobelev 2025-05-14 15:24:40 +03:00 committed by Andrey Bobelev
parent de5893392b
commit a1622b81b5
No known key found for this signature in database
GPG Key ID: FDBD92BC4F52F461

View File

@ -82,6 +82,12 @@ func mergeDERPMaps(derpMaps []*tailcfg.DERPMap) *tailcfg.DERPMap {
maps.Copy(result.Regions, derpMap.Regions)
}
for id, region := range result.Regions {
if region == nil {
delete(result.Regions, id)
}
}
return &result
}