diff --git a/options.go b/options.go index f30b6aa..1e193dd 100644 --- a/options.go +++ b/options.go @@ -131,7 +131,8 @@ func (o *Options) Validate() error { msgs = append(msgs, "missing setting: client-secret") } if o.AuthenticatedEmailsFile == "" && len(o.EmailDomains) == 0 && o.HtpasswdFile == "" { - msgs = append(msgs, "missing setting for email validation: email-domain or authenticated-emails-file required.\n use email-domain=* to authorize all email addresses") + msgs = append(msgs, "missing setting for email validation: email-domain or authenticated-emails-file required."+ + "\n use email-domain=* to authorize all email addresses") } o.redirectURL, msgs = parseURL(o.RedirectURL, "redirect", msgs) @@ -139,14 +140,13 @@ func (o *Options) Validate() error { for _, u := range o.Upstreams { upstreamURL, err := url.Parse(u) if err != nil { - msgs = append(msgs, fmt.Sprintf( - "error parsing upstream=%q %s", - upstreamURL, err)) + msgs = append(msgs, fmt.Sprintf("error parsing upstream: %s", err)) + } else { + if upstreamURL.Path == "" { + upstreamURL.Path = "/" + } + o.proxyURLs = append(o.proxyURLs, upstreamURL) } - if upstreamURL.Path == "" { - upstreamURL.Path = "/" - } - o.proxyURLs = append(o.proxyURLs, upstreamURL) } for _, u := range o.SkipAuthRegex {