1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

avoid creating an array an then doing a join by use of string interpolation

This commit is contained in:
Vipul A M 2013-07-21 01:44:33 +05:30
parent fef89bd28c
commit 91127334a9

View file

@ -454,7 +454,7 @@ module Sinatra
hash.each do |key, value|
key = key.to_s.tr('_', '-')
value = value.to_i if key == "max-age"
values << [key, value].join('=')
values << "#{key}=#{value}"
end
response['Cache-Control'] = values.join(', ') if values.any?