mirror of
https://github.com/github/rails.git
synced 2026-01-30 08:48:06 -05:00
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
This commit is contained in:
@@ -167,7 +167,11 @@ module ActionController
|
||||
# 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user