!fix: Disallow access urls without valid scheme (#6548)

Existing deployments will need to prepend a scheme if they have not already.
This commit is contained in:
Steven Masley
2023-03-09 21:37:19 -06:00
committed by GitHub
parent 65878b04ce
commit 11a930e779

View File

@ -295,7 +295,8 @@ flags, and YAML configuration. The precedence is as follows:
return xerrors.Errorf("TLS is disabled. Enable with --tls-enable or specify a HTTP address")
}
if cfg.AccessURL.String() != "" && cfg.AccessURL.Scheme == "" {
if cfg.AccessURL.String() != "" &&
!(cfg.AccessURL.Scheme == "http" || cfg.AccessURL.Scheme == "https") {
return xerrors.Errorf("access-url must include a scheme (e.g. 'http://' or 'https://)")
}