From d5045e5a1dc8bc73da8d6240108815a412d4a195 Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Wed, 20 Jan 2021 11:47:24 +0530 Subject: [PATCH] proxy: don't panic when no host is specified --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index c7ef638..f9bc032 100644 --- a/main.go +++ b/main.go @@ -40,7 +40,8 @@ func genericHTTPProxy(w http.ResponseWriter, req *http.Request) { } if len(host) <= 0 { - log.Panic("No host in query parameters.") + io.WriteString(w, "No host in query parameters.") + return } path := req.URL.Path