Skip to content

Commit

Permalink
[#4022] use javascript content-type for jsonp responses
Browse files Browse the repository at this point in the history
  • Loading branch information
wardi committed Feb 16, 2018
1 parent 90c5334 commit bcc4b7d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ckan/controllers/api.py
Expand Up @@ -36,6 +36,7 @@
'text': 'text/plain;charset=utf-8',
'html': 'text/html;charset=utf-8',
'json': 'application/json;charset=utf-8',
'javascript': 'application/javascript;charset=utf-8',
}


Expand Down Expand Up @@ -97,6 +98,7 @@ def _finish(self, status_int, response_data=None,
# escape callback to remove '<', '&', '>' chars
callback = cgi.escape(request.params['callback'])
response_msg = self._wrap_jsonp(callback, response_msg)
response.headers['Content-Type'] = CONTENT_TYPES['javascript']
return response_msg

def _finish_ok(self, response_data=None,
Expand Down

0 comments on commit bcc4b7d

Please sign in to comment.