aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-12-17 22:10:06 -0600
committerJoshua Peek <josh@joshpeek.com>2009-12-17 22:10:37 -0600
commit2419fae092ec207185f9ed69c2aa1ba1cd53fffe (patch)
treedd2f9856c31a0e1135cba0ce8ee73af5e10dad16 /actionpack/lib
parent3b44f35e242cc372749f43f0f24dea0138e6ab8d (diff)
downloadrails-2419fae092ec207185f9ed69c2aa1ba1cd53fffe.tar.gz
rails-2419fae092ec207185f9ed69c2aa1ba1cd53fffe.tar.bz2
rails-2419fae092ec207185f9ed69c2aa1ba1cd53fffe.zip
Pending tests for AD Response
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/http/response.rb25
1 files changed, 12 insertions, 13 deletions
diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb
index 378fd5e61d..6e63fc0067 100644
--- a/actionpack/lib/action_dispatch/http/response.rb
+++ b/actionpack/lib/action_dispatch/http/response.rb
@@ -145,18 +145,6 @@ module ActionDispatch # :nodoc:
cattr_accessor(:default_charset) { "utf-8" }
- def assign_default_content_type_and_charset!
- return if headers[CONTENT_TYPE].present?
-
- @content_type ||= Mime::HTML
- @charset ||= self.class.default_charset
-
- type = @content_type.to_s.dup
- type << "; charset=#{@charset}" unless @sending_file
-
- headers[CONTENT_TYPE] = type
- end
-
def to_a
assign_default_content_type_and_charset!
handle_conditional_get!
@@ -259,6 +247,18 @@ module ActionDispatch # :nodoc:
!@blank && @body.respond_to?(:all?) && @body.all? { |part| part.is_a?(String) }
end
+ def assign_default_content_type_and_charset!
+ return if headers[CONTENT_TYPE].present?
+
+ @content_type ||= Mime::HTML
+ @charset ||= self.class.default_charset
+
+ type = @content_type.to_s.dup
+ type << "; charset=#{@charset}" unless @sending_file
+
+ headers[CONTENT_TYPE] = type
+ end
+
DEFAULT_CACHE_CONTROL = "max-age=0, private, must-revalidate"
def set_conditional_cache_control!
@@ -280,7 +280,6 @@ module ActionDispatch # :nodoc:
headers["Cache-Control"] = options.join(", ")
end
-
end
end
end