Commit e4569081 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Remove unnecessary function

parent d55aa579
......@@ -39,11 +39,7 @@ type Upstream struct {
}
func (u *Upstream) URLPrefix() urlprefix.Prefix {
u.configureURLPrefixOnce.Do(u.configureURLPrefix)
return u.urlPrefix
}
func (u *Upstream) configureURLPrefix() {
u.configureURLPrefixOnce.Do(func() {
if u.Backend == nil {
u.Backend = DefaultBackend
}
......@@ -52,6 +48,9 @@ func (u *Upstream) configureURLPrefix() {
relativeURLRoot += "/"
}
u.urlPrefix = urlprefix.Prefix(relativeURLRoot)
})
return u.urlPrefix
}
func (u *Upstream) RoundTripper() *badgateway.RoundTripper {
......@@ -61,6 +60,7 @@ func (u *Upstream) RoundTripper() *badgateway.RoundTripper {
ResponseHeaderTimeout: u.ResponseHeaderTimeout,
}
})
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