Skip to content

Commit

Permalink
strip fqdn spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed May 19, 2021
1 parent 52e9e7a commit 0c1218b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ func makeSSLConfig() (config proxy.SSLConfig, err error) {
config.SSLMode = proxy.SSLAuto
config.ACMELocation = opts.SSL.ACMELocation
config.ACMEEmail = opts.SSL.ACMEEmail
config.FQDNs = opts.SSL.FQDNs
config.FQDNs = fqdns(opts.SSL.FQDNs)
config.RedirHTTPPort = redirHTTPPort(opts.SSL.RedirHTTPPort)
}
return config, err
Expand Down Expand Up @@ -401,6 +401,14 @@ func redirHTTPPort(port int) int {
return 80
}

// fqdns cleans space suffixes and prefixes which can sneak in from docker compose
func fqdns(inp []string) (res []string) {
for _, v := range inp {
res = append(res, strings.TrimSpace(v))
}
return res
}

func sizeParse(inp string) (uint64, error) {
if inp == "" {
return 0, errors.New("empty value")
Expand Down

0 comments on commit 0c1218b

Please sign in to comment.