mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-05 18:44:58 +03:00
Set listenHost to localhost if empty; fixes test on Windows
This commit is contained in:
parent
1da70d3ba1
commit
e641d2fd65
1 changed files with 4 additions and 0 deletions
|
@ -29,6 +29,10 @@ func HTTPChallengeHandler(w http.ResponseWriter, r *http.Request, listenHost, al
|
||||||
scheme = "https"
|
scheme = "https"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if listenHost == "" {
|
||||||
|
listenHost = "localhost"
|
||||||
|
}
|
||||||
|
|
||||||
upstream, err := url.Parse(fmt.Sprintf("%s://%s:%s", scheme, listenHost, altPort))
|
upstream, err := url.Parse(fmt.Sprintf("%s://%s:%s", scheme, listenHost, altPort))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
w.WriteHeader(http.StatusInternalServerError)
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
|
Loading…
Reference in a new issue