Module: Falcon::Environment::Redirect
- Includes:
- Server
- Defined in:
- lib/falcon/environment/redirect.rb
Overview
Provides an environment for redirecting insecure web traffic to a secure endpoint.
Instance Method Summary collapse
-
#environments ⇒ Object
The services we will redirect to.
- #hosts ⇒ Object
-
#middleware ⇒ Object
Load the Middleware::Redirect application with the specified hosts.
- #redirect_endpoint ⇒ Object
- #redirect_url ⇒ Object
Methods included from Server
#authority, #cache, #client_endpoint, #container_options, #endpoint, #preload, #service_class, #timeout, #url, #verbose
Instance Method Details
#environments ⇒ Object
The services we will redirect to.
25 26 27 |
# File 'lib/falcon/environment/redirect.rb', line 25 def environments [] end |
#hosts ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/falcon/environment/redirect.rb', line 29 def hosts hosts = {} environments.each do |environment| evaluator = environment.evaluator if environment.implements?(Falcon::Environment::Application) Console.info(self) {"Redirecting #{self.url} to #{evaluator.}"} hosts[evaluator.] = evaluator end end return hosts end |
#middleware ⇒ Object
Load the Middleware::Redirect application with the specified hosts.
45 46 47 |
# File 'lib/falcon/environment/redirect.rb', line 45 def middleware Middleware::Redirect.new(Middleware::NotFound, hosts, redirect_endpoint) end |
#redirect_endpoint ⇒ Object
19 20 21 |
# File 'lib/falcon/environment/redirect.rb', line 19 def redirect_endpoint Async::HTTP::Endpoint.parse(redirect_url) end |
#redirect_url ⇒ Object
15 16 17 |
# File 'lib/falcon/environment/redirect.rb', line 15 def redirect_url "https://[::]:443" end |