File tree 3 files changed +0
-24
lines changed
3 files changed +0
-24
lines changed Original file line number Diff line number Diff line change @@ -40,13 +40,6 @@ grpc_listen_addr: 127.0.0.1:50443
40
40
# are doing.
41
41
grpc_allow_insecure : false
42
42
43
- # The Access-Control-Allow-Origin header specifies which origins are allowed to access resources.
44
- # Options:
45
- # - "*" to allow access from any origin (not recommended for sensitive data).
46
- # - "http://example.com" to only allow access from a specific origin.
47
- # - "" to disable Cross-Origin Resource Sharing (CORS).
48
- Access-Control-Allow-Origin : " "
49
-
50
43
# The Noise section includes specific configuration for the
51
44
# TS2021 Noise protocol
52
45
noise :
Original file line number Diff line number Diff line change @@ -454,21 +454,10 @@ func (h *Headscale) ensureUnixSocketIsAbsent() error {
454
454
return os .Remove (h .cfg .UnixSocket )
455
455
}
456
456
457
- func (h * Headscale ) corsHeadersMiddleware (next http.Handler ) http.Handler {
458
- return http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
459
- w .Header ().Set ("Access-Control-Allow-Origin" , h .cfg .AccessControlAllowOrigins )
460
- next .ServeHTTP (w , r )
461
- })
462
- }
463
-
464
457
func (h * Headscale ) createRouter (grpcMux * grpcRuntime.ServeMux ) * mux.Router {
465
458
router := mux .NewRouter ()
466
459
router .Use (prometheusMiddleware )
467
460
468
- if h .cfg .AccessControlAllowOrigins != "" {
469
- router .Use (h .corsHeadersMiddleware )
470
- }
471
-
472
461
router .HandleFunc (ts2021UpgradePath , h .NoiseUpgradeHandler ).Methods (http .MethodPost , http .MethodGet )
473
462
474
463
router .HandleFunc ("/health" , h .HealthHandler ).Methods (http .MethodGet )
Original file line number Diff line number Diff line change @@ -63,8 +63,6 @@ type Config struct {
63
63
Log LogConfig
64
64
DisableUpdateCheck bool
65
65
66
- AccessControlAllowOrigins string
67
-
68
66
Database DatabaseConfig
69
67
70
68
DERP DERPConfig
@@ -305,8 +303,6 @@ func LoadConfig(path string, isFile bool) error {
305
303
viper .SetDefault ("tuning.batch_change_delay" , "800ms" )
306
304
viper .SetDefault ("tuning.node_mapsession_buffered_chan_size" , 30 )
307
305
308
- viper .SetDefault ("Access-Control-Allow-Origin" , "" )
309
-
310
306
viper .SetDefault ("prefixes.allocation" , string (IPAllocationStrategySequential ))
311
307
312
308
if err := viper .ReadInConfig (); err != nil {
@@ -872,8 +868,6 @@ func LoadServerConfig() (*Config, error) {
872
868
GRPCAllowInsecure : viper .GetBool ("grpc_allow_insecure" ),
873
869
DisableUpdateCheck : false ,
874
870
875
- AccessControlAllowOrigins : viper .GetString ("Access-Control-Allow-Origin" ),
876
-
877
871
PrefixV4 : prefix4 ,
878
872
PrefixV6 : prefix6 ,
879
873
IPAllocation : IPAllocationStrategy (alloc ),
You can’t perform that action at this time.
0 commit comments