Merge pull request #12 from apache/uacheck
Missing UA is represented by "-"
Tested locally
diff --git a/server/app/endpoints/downloads.py b/server/app/endpoints/downloads.py
index c6ce452..2ccaa75 100644
--- a/server/app/endpoints/downloads.py
+++ b/server/app/endpoints/downloads.py
@@ -89,7 +89,7 @@
# Various standard filters for weeding out bogus requests
if "empty_ua" in filters: # Empty User-Agent header, usually automation gone wrong
- q = q.exclude("terms", **{field_names["useragent"]+".keyword": [""]})
+ q = q.exclude("terms", **{field_names["useragent"]+".keyword": ["", "-"]})
# TODO: Make this not extremely slow. For now, we'll filter in post.
#if "no_query" in filters: # Don't show results with query strings in them
# q = q.exclude("wildcard", **{field_names["uri"]+".keyword": "*="})