mirror of
https://github.com/juanfont/headscale.git
synced 2025-08-05 13:49:57 +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:
parent
6d9ad7fe5d
commit
7a2016ca62
@ -73,7 +73,11 @@ func mergeDERPMaps(derpMaps []*tailcfg.DERPMap) *tailcfg.DERPMap {
|
||||
|
||||
for _, derpMap := range derpMaps {
|
||||
for id, region := range derpMap.Regions {
|
||||
result.Regions[id] = region
|
||||
if region == nil {
|
||||
delete(result.Regions, id)
|
||||
} else {
|
||||
result.Regions[id] = region
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user