aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/middleware/ssl.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 18:51:43 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 18:51:43 +0200
commit628e51ff109334223094e30ad1365188bbd7f9c6 (patch)
tree6bf28936ffa0fb4fe2390b933958053daeffbc90 /actionpack/lib/action_dispatch/middleware/ssl.rb
parent4b6c68dfb810c836f87587a16353317d1a180805 (diff)
downloadrails-628e51ff109334223094e30ad1365188bbd7f9c6.tar.gz
rails-628e51ff109334223094e30ad1365188bbd7f9c6.tar.bz2
rails-628e51ff109334223094e30ad1365188bbd7f9c6.zip
applies new string literal convention in actionpack/lib
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/ssl.rb')
-rw-r--r--actionpack/lib/action_dispatch/middleware/ssl.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/ssl.rb b/actionpack/lib/action_dispatch/middleware/ssl.rb
index 0e04d3a524..0b81d0ad43 100644
--- a/actionpack/lib/action_dispatch/middleware/ssl.rb
+++ b/actionpack/lib/action_dispatch/middleware/ssl.rb
@@ -93,7 +93,7 @@ module ActionDispatch
private
def set_hsts_header!(headers)
- headers['Strict-Transport-Security'.freeze] ||= @hsts_header
+ headers["Strict-Transport-Security".freeze] ||= @hsts_header
end
def normalize_hsts_options(options)
@@ -119,10 +119,10 @@ module ActionDispatch
end
def flag_cookies_as_secure!(headers)
- if cookies = headers['Set-Cookie'.freeze]
+ if cookies = headers["Set-Cookie".freeze]
cookies = cookies.split("\n".freeze)
- headers['Set-Cookie'.freeze] = cookies.map { |cookie|
+ headers["Set-Cookie".freeze] = cookies.map { |cookie|
if cookie !~ /;\s*secure\s*(;|$)/i
"#{cookie}; secure"
else
@@ -134,8 +134,8 @@ module ActionDispatch
def redirect_to_https(request)
[ @redirect.fetch(:status, 301),
- { 'Content-Type' => 'text/html',
- 'Location' => https_location_for(request) },
+ { "Content-Type" => "text/html",
+ "Location" => https_location_for(request) },
@redirect.fetch(:body, []) ]
end