Permalink
Browse files

Fixed that integration simulation of XHRs should set Accept header as…

… well [Edward Frederick]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4633 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 2b3cc24 commit df7efd7e211f61a3954936f119075cc5e20e4521 @dhh dhh committed Jul 31, 2006
Showing with 5 additions and 1 deletion.
  1. +5 −1 actionpack/lib/action_controller/integration.rb
View
6 actionpack/lib/action_controller/integration.rb
@@ -167,7 +167,11 @@ def #{method}(path, parameters=nil, headers=nil)
# should be a hash. The keys will automatically be upcased, with the
# prefix 'HTTP_' added if needed.
def xml_http_request(path, parameters=nil, headers=nil)
- headers = (headers || {}).merge("X-Requested-With" => "XMLHttpRequest")
+ headers = (headers || {}).merge(
+ "X-Requested-With" => "XMLHttpRequest"
+ "Accept" => "text/javascript, text/html, application/xml, text/xml, */*"
+ )
+
post(path, parameters, headers)
end

0 comments on commit df7efd7

Please sign in to comment.