diff options
author | Jamis Buck <jamis@37signals.com> | 2006-03-18 15:09:27 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2006-03-18 15:09:27 +0000 |
commit | 9d7de52c2d0ff73e5b9f3bc942db3ada64abe28b (patch) | |
tree | b5db87a1f6023dc4138175aec6c4b331d3c6efc5 /actionpack | |
parent | 36ea93e4b9dd880cb0803de624fe77ed0ffc2c53 (diff) | |
download | rails-9d7de52c2d0ff73e5b9f3bc942db3ada64abe28b.tar.gz rails-9d7de52c2d0ff73e5b9f3bc942db3ada64abe28b.tar.bz2 rails-9d7de52c2d0ff73e5b9f3bc942db3ada64abe28b.zip |
Add Integration::Session.accept for setting the HTTP Accept header to use (defaults to FF 1.5 value)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3924 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/integration.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/integration.rb b/actionpack/lib/action_controller/integration.rb index fd9f848f5e..7d4a0f528b 100644 --- a/actionpack/lib/action_controller/integration.rb +++ b/actionpack/lib/action_controller/integration.rb @@ -31,6 +31,9 @@ module ActionController # The remote_addr used in the last request. attr_accessor :remote_addr + # The Accept header to send. + attr_accessor :accept + # A map of the cookies returned by the last response, and which will be # sent with the next request. attr_reader :cookies @@ -66,6 +69,7 @@ module ActionController self.host = "www.example.test" self.remote_addr = "127.0.0.1" + self.accept = "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" unless @named_routes_configured # install the named routes in this session instance. @@ -209,7 +213,8 @@ module ActionController "CONTENT_TYPE" => "application/x-www-form-urlencoded", "CONTENT_LENGTH" => data ? data.length.to_s : nil, "HTTP_COOKIE" => encode_cookies, - "HTTPS" => https? ? "on" : "off" + "HTTPS" => https? ? "on" : "off", + "HTTP_ACCEPT" => accept ) (headers || {}).each do |key, value| |