From e641d2fd65a6772cda7e003d2a446789804352bc Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Fri, 23 Dec 2016 10:28:00 -0700 Subject: [PATCH] Set listenHost to localhost if empty; fixes test on Windows --- caddytls/httphandler.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/caddytls/httphandler.go b/caddytls/httphandler.go index 755d4858..0ea40c67 100644 --- a/caddytls/httphandler.go +++ b/caddytls/httphandler.go @@ -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)