Class: Lotus::Routing::ForceSsl Private
- Inherits:
-
Object
- Object
- Lotus::Routing::ForceSsl
- Defined in:
- lib/lotus/routing/force_ssl.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Force ssl
Redirect response to the secure equivalent resource (https)
Constant Summary collapse
- SSL_SCHEME =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Https scheme
'https'.freeze
- HTTPS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'HTTPS'.freeze
- ON =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'on'.freeze
- LOCATION_HEADER =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Location header
'Location'.freeze
- DEFAULT_HTTP_PORT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Default http port
80
- DEFAULT_SSL_PORT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Default ssl port
443
- MOVED_PERMANENTLY_HTTP_CODE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Moved Permanently http code
301
- TEMPORARY_REDIRECT_HTTP_CODE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Temporary Redirect http code
307
- HTTP_X_FORWARDED_SSL =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'HTTP_X_FORWARDED_SSL'.freeze
- HTTP_X_FORWARDED_SCHEME =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'HTTP_X_FORWARDED_SCHEME'.freeze
- HTTP_X_FORWARDED_PROTO =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'HTTP_X_FORWARDED_PROTO'.freeze
- HTTP_X_FORWARDED_PROTO_SEPARATOR =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
','.freeze
- RACK_URL_SCHEME =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'rack.url_scheme'.freeze
- REQUEST_METHOD =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'REQUEST_METHOD'.freeze
- IDEMPOTENT_METHODS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
['GET', 'HEAD'].freeze
- EMPTY_BODY =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
[].freeze
Instance Method Summary collapse
-
#call(env) ⇒ Array
private
Set 301 status and Location header if this feature is activated.
-
#force?(env) ⇒ Boolean
private
Check if router has to force the response with ssl.
-
#initialize(active, options = {}) ⇒ ForceSsl
constructor
private
Initialize ForceSsl.
Constructor Details
#initialize(active, options = {}) ⇒ ForceSsl
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize ForceSsl.
95 96 97 98 99 100 101 |
# File 'lib/lotus/routing/force_ssl.rb', line 95 def initialize(active, = {}) @active = active @host = [:host] @port = [:port] _redefine_call end |
Instance Method Details
#call(env) ⇒ Array
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Set 301 status and Location header if this feature is activated.
113 114 |
# File 'lib/lotus/routing/force_ssl.rb', line 113 def call(env) end |
#force?(env) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Check if router has to force the response with ssl
122 123 124 |
# File 'lib/lotus/routing/force_ssl.rb', line 122 def force?(env) !ssl?(env) end |