ssl_routes 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ssl_routes/rails3.rb +10 -8
- data/lib/ssl_routes/version.rb +1 -1
- metadata +9 -9
data/lib/ssl_routes/rails3.rb
CHANGED
@@ -62,14 +62,16 @@ module SslRoutes
|
|
62
62
|
module InstanceMethods
|
63
63
|
|
64
64
|
def url_for_with_ssl_support(options)
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
65
|
+
if options[:only_path] == true
|
66
|
+
ac = self.respond_to?(:controller) ? self.controller : self
|
67
|
+
if ac.respond_to?(:enable_ssl) && ac.enable_ssl
|
68
|
+
case options
|
69
|
+
when Hash
|
70
|
+
current, target = ac.determine_protocols(options)
|
71
|
+
if current != target
|
72
|
+
options.merge!({ :protocol => target, :only_path => false })
|
73
|
+
end
|
74
|
+
end
|
73
75
|
end
|
74
76
|
end
|
75
77
|
url_for_without_ssl_support(options)
|
data/lib/ssl_routes/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ssl_routes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Cedric Howe
|
@@ -15,12 +15,10 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-08-
|
18
|
+
date: 2011-08-25 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
|
-
|
22
|
-
prerelease: false
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
21
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
24
22
|
none: false
|
25
23
|
requirements:
|
26
24
|
- - ">="
|
@@ -30,8 +28,10 @@ dependencies:
|
|
30
28
|
- 2
|
31
29
|
- 3
|
32
30
|
version: "2.3"
|
31
|
+
prerelease: false
|
33
32
|
type: :runtime
|
34
|
-
|
33
|
+
requirement: *id001
|
34
|
+
name: rails
|
35
35
|
description: Define your SSL settings in one place to enforce in your controller, generate URLs with the correct protocol, and protect yourself against session hijacking.
|
36
36
|
email: cedric@howe.net
|
37
37
|
executables: []
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
requirements: []
|
79
79
|
|
80
80
|
rubyforge_project: ssl_routes
|
81
|
-
rubygems_version: 1.
|
81
|
+
rubygems_version: 1.8.6
|
82
82
|
signing_key:
|
83
83
|
specification_version: 3
|
84
84
|
summary: Enforce SSL based on your Rails routes.
|