From 643b8a5b9cb95ae41ff4f9eccb196bdb13e37cb4 Mon Sep 17 00:00:00 2001 From: Mark van der Velden Date: Thu, 27 Apr 2017 20:04:51 +0200 Subject: [PATCH] Making sure that requests without `url` parameter don't complain about invalid domains. --- handlers/urlparameters.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handlers/urlparameters.go b/handlers/urlparameters.go index b1c712f..dadcc38 100644 --- a/handlers/urlparameters.go +++ b/handlers/urlparameters.go @@ -16,7 +16,7 @@ func NewValidateURLParameter(l log.Logger, allowedHosts []string) func(h http.Ha return func(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { queryURL := r.URL.Query().Get("url") - if !isValidQueryURL(queryURL, hosts) { + if queryURL != "" && !isValidQueryURL(queryURL, hosts) { l.Log("error", "domain not registered", "QS", r.URL.RawQuery, "URL", queryURL) http.Error(w, "Unregisterd domain", http.StatusNotAcceptable) return