aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-03-13 16:21:41 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2012-03-14 12:46:23 -0300
commit4c16791f355c74f8e6ad916e67fd4ae81efbf708 (patch)
tree4d0bac9dddd90c1b7ffaea3f309e79c0b7468154 /actionpack/lib/action_dispatch
parentcc1c4acc8eeee4287627b1d184d7d04a22eddb27 (diff)
downloadrails-4c16791f355c74f8e6ad916e67fd4ae81efbf708.tar.gz
rails-4c16791f355c74f8e6ad916e67fd4ae81efbf708.tar.bz2
rails-4c16791f355c74f8e6ad916e67fd4ae81efbf708.zip
Add ActionController::HTTP
More info http://edgeguides.rubyonrails.org/api_app.html [Carlos Antonio da Silva & Santiago Pastorino]
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/http/response.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb
index 84732085f0..078229efd2 100644
--- a/actionpack/lib/action_dispatch/http/response.rb
+++ b/actionpack/lib/action_dispatch/http/response.rb
@@ -51,12 +51,13 @@ module ActionDispatch # :nodoc:
# If a character set has been defined for this response (see charset=) then
# the character set information will also be included in the content type
# information.
- attr_accessor :charset, :content_type
+ attr_accessor :charset
+ attr_reader :content_type
CONTENT_TYPE = "Content-Type".freeze
SET_COOKIE = "Set-Cookie".freeze
LOCATION = "Location".freeze
-
+
cattr_accessor(:default_charset) { "utf-8" }
include Rack::Response::Helpers
@@ -83,6 +84,10 @@ module ActionDispatch # :nodoc:
@status = Rack::Utils.status_code(status)
end
+ def content_type=(content_type)
+ @content_type = content_type.to_s
+ end
+
# The response code of the request
def response_code
@status