mirror of
				https://github.com/juanfont/headscale.git
				synced 2025-10-28 10:51:44 +01: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
							
								
									630bfd265a
								
							
						
					
					
						commit
						d29feaef79
					
				| @ -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 | ||||
| } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user