diff --git a/config-example.yaml b/config-example.yaml index 0f0f210d2b..68f0122b2e 100644 --- a/config-example.yaml +++ b/config-example.yaml @@ -45,7 +45,7 @@ grpc_allow_insecure: false # - "*" to allow access from any origin (not recommended for sensitive data). # - "http://example.com" to only allow access from a specific origin. # - "" to disable Cross-Origin Resource Sharing (CORS). -Access-Control-Allow-Origin: "" +access_control_allow_origin: "" # The Noise section includes specific configuration for the # TS2021 Noise protocol diff --git a/hscontrol/types/config.go b/hscontrol/types/config.go index c91cd62d43..16b9d63a0a 100644 --- a/hscontrol/types/config.go +++ b/hscontrol/types/config.go @@ -305,7 +305,7 @@ func LoadConfig(path string, isFile bool) error { viper.SetDefault("tuning.batch_change_delay", "800ms") viper.SetDefault("tuning.node_mapsession_buffered_chan_size", 30) - viper.SetDefault("Access-Control-Allow-Origin", "") + viper.SetDefault("access_control_allow_origin", "") viper.SetDefault("prefixes.allocation", string(IPAllocationStrategySequential)) @@ -872,7 +872,7 @@ func LoadServerConfig() (*Config, error) { GRPCAllowInsecure: viper.GetBool("grpc_allow_insecure"), DisableUpdateCheck: false, - AccessControlAllowOrigins: viper.GetString("Access-Control-Allow-Origin"), + AccessControlAllowOrigins: viper.GetString("access_control_allow_origin"), PrefixV4: prefix4, PrefixV6: prefix6,