aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-11-25 19:29:10 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-11-25 19:29:10 +0000
commit396b3f2befe5d75ac04e732eae195dc6d9d20201 (patch)
treed1512f26312cd79306c34ad2e563658476484544 /actionpack/lib/action_controller/base.rb
parentcf248eae1f32811400261e2e35d863cb1a549523 (diff)
downloadrails-396b3f2befe5d75ac04e732eae195dc6d9d20201.tar.gz
rails-396b3f2befe5d75ac04e732eae195dc6d9d20201.tar.bz2
rails-396b3f2befe5d75ac04e732eae195dc6d9d20201.zip
Dont set default charset if the response is sending a file. Closes #6689 [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5626 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/base.rb')
-rwxr-xr-xactionpack/lib/action_controller/base.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 9b4b729e8d..288e6d2912 100755
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -1087,7 +1087,11 @@ module ActionController #:nodoc:
def assign_default_content_type_and_charset
response.content_type ||= Mime::HTML
- response.charset ||= self.class.default_charset
+ response.charset ||= self.class.default_charset unless sending_file?
+ end
+
+ def sending_file?
+ response.headers["Content-Transfer-Encoding"] == "binary"
end
def action_methods