1
0
Fork 0

Query params in health check

This commit is contained in:
Michael 2018-11-15 15:50:03 +01:00 committed by Traefiker Bot
parent 0be895febb
commit fa562dc916
2 changed files with 75 additions and 14 deletions

View file

@ -58,8 +58,10 @@ type BackendConfig struct {
}
func (b *BackendConfig) newRequest(serverURL *url.URL) (*http.Request, error) {
u := &url.URL{}
*u = *serverURL
u, err := serverURL.Parse(b.Path)
if err != nil {
return nil, err
}
if len(b.Scheme) > 0 {
u.Scheme = b.Scheme
@ -69,8 +71,6 @@ func (b *BackendConfig) newRequest(serverURL *url.URL) (*http.Request, error) {
u.Host = net.JoinHostPort(u.Hostname(), strconv.Itoa(b.Port))
}
u.Path += b.Path
return http.NewRequest(http.MethodGet, u.String(), http.NoBody)
}