提交 6b15a45e 编写于 作者: O Olli Jokinen

Change mimetype to Mime::JS if JSONP is used

上级 30dae273
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册