1
0
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:
Andrey Bobelev 2025-05-14 15:24:40 +03:00
parent 6d9ad7fe5d
commit 7a2016ca62
No known key found for this signature in database
GPG Key ID: 8BC07FB9FEAEEF63

View File

@ -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
}
}
}