Set listenHost to localhost if empty; fixes test on Windows

This commit is contained in:
Matthew Holt 2016-12-23 10:28:00 -07:00
parent 1da70d3ba1
commit e641d2fd65
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5

View file

@ -29,6 +29,10 @@ func HTTPChallengeHandler(w http.ResponseWriter, r *http.Request, listenHost, al
scheme = "https"
}
if listenHost == "" {
listenHost = "localhost"
}
upstream, err := url.Parse(fmt.Sprintf("%s://%s:%s", scheme, listenHost, altPort))
if err != nil {
w.WriteHeader(http.StatusInternalServerError)