diff options
author | Yehuda Katz <wycats@gmail.com> | 2009-02-02 09:54:23 -0800 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-02-02 09:54:23 -0800 |
commit | 44cdf0c5fe080d470429ab0640af25e927244907 (patch) | |
tree | 0dcaa131da49eaeb0e056d0b4cc03673bf5af4c2 /actionpack/lib/action_dispatch/http | |
parent | 3030bc90c95e335d726f06fd7a61ed96055e9109 (diff) | |
download | rails-44cdf0c5fe080d470429ab0640af25e927244907.tar.gz rails-44cdf0c5fe080d470429ab0640af25e927244907.tar.bz2 rails-44cdf0c5fe080d470429ab0640af25e927244907.zip |
Some merge cleanup
Diffstat (limited to 'actionpack/lib/action_dispatch/http')
-rwxr-xr-x | actionpack/lib/action_dispatch/http/request.rb | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index 366ac26421..94cce869f7 100755 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -94,25 +94,26 @@ module ActionDispatch end end end - + # Returns the accepted MIME type for the request. def accepts @accepts ||= begin header = @env['HTTP_ACCEPT'].to_s.strip - fallback = xhr? ? Mime::JS : Mime::HTML + fallback = xhr? ? Mime::JS : Mime::HTML - if header.empty? - [content_type, fallback, Mime::ALL].compact - else - ret = Mime::Type.parse(header) - if ret.last == Mime::ALL - ret.insert(-2, fallback) + if header.empty? + [content_type, fallback, Mime::ALL].compact + else + ret = Mime::Type.parse(header) + if ret.last == Mime::ALL + ret.insert(-2, fallback) + end + ret end - ret end end - + def if_modified_since if since = env['HTTP_IF_MODIFIED_SINCE'] Time.rfc2822(since) rescue nil |