From df7efd7e211f61a3954936f119075cc5e20e4521 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 31 Jul 2006 06:18:20 +0000 Subject: [PATCH] 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 --- actionpack/lib/action_controller/integration.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/actionpack/lib/action_controller/integration.rb b/actionpack/lib/action_controller/integration.rb index d988731531..cc16f69020 100644 --- a/actionpack/lib/action_controller/integration.rb +++ b/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