summaryrefslogtreecommitdiff
path: root/web/lib
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2014-08-19 14:34:33 +0200
committerJochen Topf <jochen@topf.org>2014-08-19 14:34:33 +0200
commitcd12010108e17dfab6ebf6f2902663430505bcfe (patch)
tree296abf9dcb954d85a1d5ac778aecd4b8c1d57175 /web/lib
parent7437f074958c885c81f3e360ca4c00546f4ec53e (diff)
downloadtaginfo-cd12010108e17dfab6ebf6f2902663430505bcfe.tar
taginfo-cd12010108e17dfab6ebf6f2902663430505bcfe.tar.gz
Fix URL parameter name issue ("filter" vs. "filters").
In one case the singular was used in another the plural. Documented was only the singular version. The /api/4/keys/all call now allows both, "filter" should be used as in the documentation, but the plural is allowed for backwards compatibility. Fixes #67.
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/api/v4/keys.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/web/lib/api/v4/keys.rb b/web/lib/api/v4/keys.rb
index b6189d5..4cebc82 100644
--- a/web/lib/api/v4/keys.rb
+++ b/web/lib/api/v4/keys.rb
@@ -33,7 +33,9 @@ class Taginfo < Sinatra::Base
:ui => '/keys'
}) do
- if params[:filters]
+ if params[:filter]
+ filters = params[:filter].split(',').map{ |f| @@filters[f.to_sym][:expr] }.compact
+ elsif params[:filters] # old param name for backwards compatibility
filters = params[:filters].split(',').map{ |f| @@filters[f.to_sym][:expr] }.compact
else
filters = []