Skip to content

Commit

Permalink
Making sure that requests without url parameter don't complain abou…
Browse files Browse the repository at this point in the history
…t invalid domains.
  • Loading branch information
Dynom committed Apr 27, 2017
1 parent dfcee1e commit 643b8a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion handlers/urlparameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 643b8a5

Please sign in to comment.