Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
dhh committed Jul 31, 2006
1 parent 2b3cc24 commit df7efd7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion actionpack/lib/action_controller/integration.rb
Expand Up @@ -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

Expand Down

0 comments on commit df7efd7

Please sign in to comment.