Permalink
Browse files

support "callback" param in addition to just "_callback"

  • Loading branch information...
1 parent 6b56271 commit 0b1a5670b931739e490f23f30bd559cc662315d0 @mislav committed Feb 11, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 app.rb
View
4 app.rb
@@ -223,7 +223,7 @@ def photos_by_tag(tag)
case request.path
when /\.json$/
- callback = params['_callback']
+ callback = params['_callback'] || params[:callback]
content_type "application/#{callback ? 'javascript' : 'json'}", charset: 'utf-8'
raw_json = JSON.dump error: msg
@@ -310,7 +310,7 @@ def photos_by_tag(tag)
get '/users/:id.json' do
user = User.find_by_user_id(params[:id]) or not_found
- callback = params['_callback']
+ callback = params['_callback'] || params[:callback]
raw_json = user_photos(user, :raw_json)
content_type "application/#{callback ? 'javascript' : 'json'}", charset: 'utf-8'

0 comments on commit 0b1a567

Please sign in to comment.