diff options
author | Seth Fitzsimmons <seth@mojodna.net> | 2008-12-15 12:18:45 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-12-15 12:18:45 -0600 |
commit | 4966076d35d5d9510590d87d90dae8daf79b2069 (patch) | |
tree | a9556ab5a6c6c4972084287757be2cfc905dbfe7 | |
parent | f36dafa492e3de66e624d81d6860f5f0536de6b0 (diff) | |
download | rails-4966076d35d5d9510590d87d90dae8daf79b2069.tar.gz rails-4966076d35d5d9510590d87d90dae8daf79b2069.tar.bz2 rails-4966076d35d5d9510590d87d90dae8daf79b2069.zip |
Use Mime::JS in place of explicit 'text/javascript' [#1573 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
-rw-r--r-- | actionpack/lib/action_controller/integration.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_controller/test_process.rb | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/integration.rb b/actionpack/lib/action_controller/integration.rb index 0f0db03b6b..212a293da0 100644 --- a/actionpack/lib/action_controller/integration.rb +++ b/actionpack/lib/action_controller/integration.rb @@ -227,9 +227,7 @@ module ActionController def xml_http_request(request_method, path, parameters = nil, headers = nil) headers ||= {} headers['X-Requested-With'] = 'XMLHttpRequest' - headers['Accept'] ||= 'text/javascript, text/html, application/xml, ' + - 'text/xml, */*' - + headers['Accept'] ||= [Mime::JS, Mime::HTML, Mime::XML, 'text/xml', Mime::ALL].join(', ') process(request_method, path, parameters, headers) end alias xhr :xml_http_request diff --git a/actionpack/lib/action_controller/test_process.rb b/actionpack/lib/action_controller/test_process.rb index 78dc3827bc..c35c3c07e8 100644 --- a/actionpack/lib/action_controller/test_process.rb +++ b/actionpack/lib/action_controller/test_process.rb @@ -413,7 +413,7 @@ module ActionController #:nodoc: def xml_http_request(request_method, action, parameters = nil, session = nil, flash = nil) @request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' - @request.env['HTTP_ACCEPT'] = 'text/javascript, text/html, application/xml, text/xml, */*' + @request.env['HTTP_ACCEPT'] = [Mime::JS, Mime::HTML, Mime::XML, 'text/xml', Mime::ALL].join(', ') returning __send__(request_method, action, parameters, session, flash) do @request.env.delete 'HTTP_X_REQUESTED_WITH' @request.env.delete 'HTTP_ACCEPT' |