diff options
author | Akira Matsuda <ronnie@dio.jp> | 2019-07-31 17:36:41 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2019-07-31 17:41:34 +0900 |
commit | 511d1abc8ad523aa3592e30b4ecf4dac92a2a352 (patch) | |
tree | db172c41ca374e8dcc0aec0b8e9c735bf82b61e1 /actionpack/lib/action_controller/metal | |
parent | 34a7e68bb9a7fa07c12092d916317f837b422a6a (diff) | |
download | rails-511d1abc8ad523aa3592e30b4ecf4dac92a2a352.tar.gz rails-511d1abc8ad523aa3592e30b4ecf4dac92a2a352.tar.bz2 rails-511d1abc8ad523aa3592e30b4ecf4dac92a2a352.zip |
Reduce method invocations and object allocations in head()
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r-- | actionpack/lib/action_controller/metal/head.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal/head.rb b/actionpack/lib/action_controller/metal/head.rb index 3c84bebb85..f290272055 100644 --- a/actionpack/lib/action_controller/metal/head.rb +++ b/actionpack/lib/action_controller/metal/head.rb @@ -29,7 +29,7 @@ module ActionController content_type = options.delete(:content_type) options.each do |key, value| - headers[key.to_s.dasherize.split("-").each { |v| v[0] = v[0].chr.upcase }.join("-")] = value.to_s + headers[key.to_s.split(/[-_]/).each { |v| v[0] = v[0].upcase }.join("-")] = value.to_s end self.status = status |