diff options
author | Tobias Lütke <tobias.luetke@gmail.com> | 2007-03-05 18:24:17 +0000 |
---|---|---|
committer | Tobias Lütke <tobias.luetke@gmail.com> | 2007-03-05 18:24:17 +0000 |
commit | e52c28a425192966379ecf4ae3b20f0b9442e9e2 (patch) | |
tree | a64f7fc0dbbb5e8201e1b6d0fe7409303aaa2aca /actionpack/lib/action_controller/request.rb | |
parent | 0e8c3b8dd974a19855f41cb319579567449461ed (diff) | |
download | rails-e52c28a425192966379ecf4ae3b20f0b9442e9e2.tar.gz rails-e52c28a425192966379ecf4ae3b20f0b9442e9e2.tar.bz2 rails-e52c28a425192966379ecf4ae3b20f0b9442e9e2.zip |
Ignore odd charset declaration in CONTENT_TYPE header which would throw off mime type lookup.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6340 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/request.rb')
-rwxr-xr-x | actionpack/lib/action_controller/request.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb index cc469e2e74..38584a6481 100755 --- a/actionpack/lib/action_controller/request.rb +++ b/actionpack/lib/action_controller/request.rb @@ -58,7 +58,8 @@ module ActionController def content_type @content_type ||= begin - content_type = @env['CONTENT_TYPE'].to_s.downcase + # Receive header sans any charset information. + content_type = @env['CONTENT_TYPE'].to_s.sub(/\s*\;.*$/, '').strip.downcase if x_post_format = @env['HTTP_X_POST_DATA_FORMAT'] case x_post_format.to_s.downcase |