Skip to content

Commit

Permalink
[#414] Prevent callback parameter breaking action api and search
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes authored and amercader committed Dec 16, 2015
1 parent 860b2f6 commit 72b327c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ckan/controllers/api.py
Expand Up @@ -180,6 +180,9 @@ def action(self, logic_function, ver=None):
gettext('Bad request data: %s') %
'Request data JSON decoded to %r but '
'it needs to be a dictionary.' % request_data)
# if callback is specified we do not want to send that to the search
if 'callback' in request_data:
del request_data['callback']
try:
result = function(context, request_data)
return_dict['success'] = True
Expand Down Expand Up @@ -538,6 +541,10 @@ def search(self, ver=None, register=None):
if 'fq' in params:
del params['fq']
params['fq'] = '+capacity:public'
# if callback is specified we do not want to send that to
# the search
if 'callback' in params:
del params['callback']
results = query.run(params)
return self._finish_ok(results)
except search.SearchError, e:
Expand Down

0 comments on commit 72b327c

Please sign in to comment.