aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Hanley <felix@userspace.com.au>2020-04-07 04:20:22 +0000
committerFelix Hanley <felix@userspace.com.au>2020-04-07 04:20:22 +0000
commitf39a00443e2785862ec2042e00b7bbf42044227d (patch)
tree0af6b207ee4b74b6e6092996a4acad4d74dc6326
parentc0c3628457901c9129ce53351fa554aa9bc9dc47 (diff)
downloadsws-f39a00443e2785862ec2042e00b7bbf42044227d.tar.gz
sws-f39a00443e2785862ec2042e00b7bbf42044227d.tar.bz2
Fix referrer filter
-rw-r--r--cmd/server/helpers.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/cmd/server/helpers.go b/cmd/server/helpers.go
index ff19e2b..4a40779 100644
--- a/cmd/server/helpers.go
+++ b/cmd/server/helpers.go
@@ -89,18 +89,18 @@ func createHitFilter(r *http.Request) map[string]interface{} {
q := r.URL.Query()
- path := q.Get("path")
- if path != "" {
+ if path := q.Get("path"); path != "" {
filter["path"] = path
}
- country := q.Get("country")
- if country != "" {
+ if country := q.Get("country"); country != "" {
filter["country_code"] = country
}
- browser := q.Get("browser")
- if browser != "" {
+ if browser := q.Get("browser"); browser != "" {
filter["ua.browser"] = browser
}
+ if referrer := q.Get("referrer"); referrer != "" {
+ filter["referrer"] = referrer
+ }
if bots := q.Get("bots"); bots != "" {
filter["ua.bot"] = (bots == "1")
}