Skip to content
Permalink
Browse files

discard requests to /collect with missing requried query vars

  • Loading branch information...
dannyvankooten committed Nov 26, 2018
1 parent d62c9b9 commit 3656fef69d44f819a3df958e9e81a47e3ab6a25a
Showing with 9 additions and 0 deletions.
  1. +9 −0 pkg/api/collect.go
@@ -186,6 +186,15 @@ func shouldCollect(r *http.Request) bool {
return false
}

// discard if required query vars are missing
requiredQueryVars := []string{"id", "h", "p"}
q := r.URL.Query()
for _, k := range requiredQueryVars {
if q.Get(k) == "" {
return false
}
}

return true
}

0 comments on commit 3656fef

Please sign in to comment.
You can’t perform that action at this time.