Skip to content

Commit 11a930e

Browse files
authored
!fix: Disallow access urls without valid scheme (coder#6548)
Existing deployments will need to prepend a scheme if they have not already.
1 parent 65878b0 commit 11a930e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cli/server.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ flags, and YAML configuration. The precedence is as follows:
295295
return xerrors.Errorf("TLS is disabled. Enable with --tls-enable or specify a HTTP address")
296296
}
297297

298-
if cfg.AccessURL.String() != "" && cfg.AccessURL.Scheme == "" {
298+
if cfg.AccessURL.String() != "" &&
299+
!(cfg.AccessURL.Scheme == "http" || cfg.AccessURL.Scheme == "https") {
299300
return xerrors.Errorf("access-url must include a scheme (e.g. 'http://' or 'https://)")
300301
}
301302

0 commit comments

Comments
 (0)