ssl_routes 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/ssl_routes/rails.rb +5 -11
- data/lib/ssl_routes/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OWRjZTk0YmFmYjBlNmI4NmM5MGUwNzg5ODcyYmFkOTYxYzRlZTdiNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjBkNTUwYWYxYWEyNzc0OThlYjNkNDM3YTg3ZWM4MDQ0NGM0MTEzNg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODQwYWQyZTMyOGI1NTUwYmQ0MjEzNTJiMWY5ZDk2MWVmNGE2OTYxNzg2NTUw
|
10
|
+
ZWQyNzk0NWQzNGFhOTg0ZjMwMjZmZWZmNjY0MWU1ODQ5M2M4NjQ4MWYwMjAz
|
11
|
+
NTFkZGI1MGMzM2M1Zjc3MzBlZjRjMGNkOTc4MDRkYzljOGM0NmU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZGQ1M2Q2MzBiNTkwNDdhNTJhYThhMDFhM2FmOWFmZWYxMTZlZjYzYTQ2NWRl
|
14
|
+
YTM5MDU2MzA0MGU4NDM2ZGZlNDQ5MzQzNWFjNmVjNzhlYWM2ODcwNjVkNTBh
|
15
|
+
MDgwMjFmZWMyM2MxMGNlNjNlNDg2MGYxMmM4YTRjMTVkMWNmZmY=
|
data/lib/ssl_routes/rails.rb
CHANGED
@@ -39,11 +39,10 @@ module SslRoutes
|
|
39
39
|
routes = Rails.application.routes
|
40
40
|
options = routes.recognize_path request.path, {:method => request.env['REQUEST_METHOD']}
|
41
41
|
current, target = determine_protocols(options)
|
42
|
-
|
43
|
-
if (current != target && safari_preloading && request.get?) || (current != target && !request.xhr? && request.get?)
|
42
|
+
if (current != target && !request.xhr? && request.get?)
|
44
43
|
flash.keep
|
45
|
-
response.headers[
|
46
|
-
response.headers[
|
44
|
+
response.headers['Cache-Control'] = 'no-cache, no-store, max-age=0, must-revalidate'
|
45
|
+
response.headers['Pragma'] = 'no-cache'
|
47
46
|
redirect_to "#{target}://#{request.host_with_port + request.fullpath}"
|
48
47
|
return false
|
49
48
|
end
|
@@ -59,8 +58,8 @@ module SslRoutes
|
|
59
58
|
|
60
59
|
def url_for_with_ssl_support(options)
|
61
60
|
ac = self.respond_to?(:controller) ? self.controller : self
|
62
|
-
if
|
63
|
-
if
|
61
|
+
if ac.respond_to?(:enable_ssl) && ac.enable_ssl
|
62
|
+
if options.is_a?(Hash)
|
64
63
|
case options
|
65
64
|
when Hash
|
66
65
|
current, target = ac.determine_protocols(options)
|
@@ -69,12 +68,7 @@ module SslRoutes
|
|
69
68
|
end
|
70
69
|
end
|
71
70
|
end
|
72
|
-
else
|
73
|
-
if options[:ssl] && ac.respond_to?(:enable_ssl) && ac.enable_ssl
|
74
|
-
options.merge!({ :protocol => 'https' })
|
75
|
-
end
|
76
71
|
end
|
77
|
-
|
78
72
|
url_for_without_ssl_support(options)
|
79
73
|
end
|
80
74
|
|
data/lib/ssl_routes/version.rb
CHANGED