Skip to content

Commit

Permalink
discard requests to /collect with missing requried query vars
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyvankooten committed Nov 26, 2018
1 parent d62c9b9 commit 3656fef
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/api/collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 3656fef

Please sign in to comment.