From 44cdf0c5fe080d470429ab0640af25e927244907 Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Mon, 2 Feb 2009 09:54:23 -0800 Subject: Some merge cleanup --- actionpack/lib/action_controller/base/base.rb | 4 ++-- actionpack/lib/action_dispatch/http/request.rb | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_controller/base/base.rb b/actionpack/lib/action_controller/base/base.rb index a01d8f25cc..29d87d8125 100644 --- a/actionpack/lib/action_controller/base/base.rb +++ b/actionpack/lib/action_controller/base/base.rb @@ -862,7 +862,7 @@ module ActionController #:nodoc: end def close_session - @_session.close if @_session && @_session.respond_to?(:close) + # @_session.close if @_session && @_session.respond_to?(:close) end def default_template(action_name = self.action_name) @@ -895,7 +895,7 @@ module ActionController #:nodoc: Base.class_eval do [ Filters, Layout, Renderer, Redirector, Responder, Benchmarking, Rescue, Flash, MimeResponds, Helpers, Cookies, Caching, Verification, Streaming, SessionManagement, - HttpAuthentication::Basic::ControllerMethods, RecordIdentifier, + HttpAuthentication::Basic::ControllerMethods, HttpAuthentication::Digest::ControllerMethods, RecordIdentifier, RequestForgeryProtection, Translation ].each do |mod| include mod 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 -- cgit v1.2.3