ssl_enforcer 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ssl_enforcer/enforcer.rb +2 -1
- data/lib/ssl_enforcer/version.rb +1 -1
- metadata +1 -1
@@ -36,6 +36,7 @@ class SSLEnforcer::Enforcer
|
|
36
36
|
# http://rack.lighthouseapp.com/projects/22435/tickets/101
|
37
37
|
scheme = (env["SERVER_PORT"] == "443") ? :https : :http
|
38
38
|
scheme = env["HTTP_X_FORWARDED_PROTO"] if env["HTTP_X_FORWARDED_PROTO"]
|
39
|
+
scheme = scheme.downcase.to_sym
|
39
40
|
|
40
41
|
# If the "only" and or "exceptions" options have not been passed, then
|
41
42
|
# we want to force SSL on ALL subdomains
|
@@ -54,7 +55,7 @@ class SSLEnforcer::Enforcer
|
|
54
55
|
## If the option was not passed, then we must assume to change all
|
55
56
|
## subdomains NOT responded to by @exceptions
|
56
57
|
if @only.empty?
|
57
|
-
return scheme
|
58
|
+
return scheme == :https
|
58
59
|
else
|
59
60
|
return true
|
60
61
|
end
|
data/lib/ssl_enforcer/version.rb
CHANGED