git.iko.soy/typeable/oauth2-proxy
on master help sign in
options: gracefully report un-parsed upstream URL
e9bbecfPierce Lopez
options.go+6−7
@@ -142,14 +142,13 @@ func (o *Options) Validate() error {
142 for _, u := range o.Upstreams {
142 for _, u := range o.Upstreams {
143 upstreamURL, err := url.Parse(u)
143 upstreamURL, err := url.Parse(u)
144 if err != nil {
144 if err != nil {
145− msgs = append(msgs, fmt.Sprintf(
145+ msgs = append(msgs, fmt.Sprintf("error parsing upstream: %s", err))
146− "error parsing upstream=%q %s",
146+ } else {
147− upstreamURL, err))
148− }
149− if upstreamURL.Path == "" {
147+ if upstreamURL.Path == "" {
150− upstreamURL.Path = "/"
148+ upstreamURL.Path = "/"
149+ }
150+ o.proxyURLs = append(o.proxyURLs, upstreamURL)
151 }
151 }
152− o.proxyURLs = append(o.proxyURLs, upstreamURL)
153 }
152 }
154
153
155 for _, u := range o.SkipAuthRegex {
154 for _, u := range o.SkipAuthRegex {