mirror of
https://github.com/umputun/reproxy.git
synced 2024-09-11 08:55:25 +03:00
strip fqdn spaces
This commit is contained in:
parent
52e9e7a738
commit
0c1218b3eb
10
app/main.go
10
app/main.go
@ -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
|
||||
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user