Commit e4569081 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Remove unnecessary function

parent d55aa579
...@@ -39,11 +39,7 @@ type Upstream struct { ...@@ -39,11 +39,7 @@ type Upstream struct {
} }
func (u *Upstream) URLPrefix() urlprefix.Prefix { func (u *Upstream) URLPrefix() urlprefix.Prefix {
u.configureURLPrefixOnce.Do(u.configureURLPrefix) u.configureURLPrefixOnce.Do(func() {
return u.urlPrefix
}
func (u *Upstream) configureURLPrefix() {
if u.Backend == nil { if u.Backend == nil {
u.Backend = DefaultBackend u.Backend = DefaultBackend
} }
...@@ -52,6 +48,9 @@ func (u *Upstream) configureURLPrefix() { ...@@ -52,6 +48,9 @@ func (u *Upstream) configureURLPrefix() {
relativeURLRoot += "/" relativeURLRoot += "/"
} }
u.urlPrefix = urlprefix.Prefix(relativeURLRoot) u.urlPrefix = urlprefix.Prefix(relativeURLRoot)
})
return u.urlPrefix
} }
func (u *Upstream) RoundTripper() *badgateway.RoundTripper { func (u *Upstream) RoundTripper() *badgateway.RoundTripper {
...@@ -61,6 +60,7 @@ func (u *Upstream) RoundTripper() *badgateway.RoundTripper { ...@@ -61,6 +60,7 @@ func (u *Upstream) RoundTripper() *badgateway.RoundTripper {
ResponseHeaderTimeout: u.ResponseHeaderTimeout, ResponseHeaderTimeout: u.ResponseHeaderTimeout,
} }
}) })
return u.roundtripper return u.roundtripper
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment