aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/cgi_process.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2005-11-16 09:05:04 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2005-11-16 09:05:04 +0000
commitba942dfc4523610ad37d2414627698563b91b125 (patch)
treed4bcccdbfdcb8eec9c1a27f1158e9c0efbd0a02f /actionpack/lib/action_controller/cgi_process.rb
parentc63f3bdc7af1ed1195d6fae4dfcdfd621638ab4d (diff)
downloadrails-ba942dfc4523610ad37d2414627698563b91b125.tar.gz
rails-ba942dfc4523610ad37d2414627698563b91b125.tar.bz2
rails-ba942dfc4523610ad37d2414627698563b91b125.zip
fewer objects, no loop in convert_content_type. Closes #2883.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3058 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/cgi_process.rb')
-rw-r--r--actionpack/lib/action_controller/cgi_process.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/cgi_process.rb b/actionpack/lib/action_controller/cgi_process.rb
index 51a0433a89..812899b327 100644
--- a/actionpack/lib/action_controller/cgi_process.rb
+++ b/actionpack/lib/action_controller/cgi_process.rb
@@ -183,11 +183,14 @@ end_msg
private
def convert_content_type!(headers)
- %w( Content-Type Content-type content-type ).each do |ct|
- if headers[ct]
- headers["type"] = headers[ct]
- headers.delete(ct)
- end
+ if header = headers.delete("Content-Type")
+ headers["type"] = header
+ end
+ if header = headers.delete("Content-type")
+ headers["type"] = header
+ end
+ if header = headers.delete("content-type")
+ headers["type"] = header
end
end
end