Permalink
Browse files

Change mimetype to Mime::JS if JSONP is used

  • Loading branch information...
1 parent 30dae27 commit 6b15a45e65addc97bcf30b9d141f97c63df898e8 @omjokine omjokine committed Jul 28, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 actionpack/lib/action_controller/metal/renderers.rb
@@ -93,7 +93,10 @@ module All
add :json do |json, options|
json = json.to_json(options) unless json.kind_of?(String)
- json = "#{options[:callback]}(#{json})" unless options[:callback].blank?
+ unless options[:callback].blank?
+ json = "#{options[:callback]}(#{json})"
+ self.content_type ||= Mime::JS
+ end
self.content_type ||= Mime::JSON
json
end

0 comments on commit 6b15a45

Please sign in to comment.