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, #count, #endpoint, #endpoint_options, #make_server, #preload, #service_class, #timeout, #url, #verbose
Instance Method Details
#environments ⇒ Object
The services we will redirect to.
26 27 28 |
# File 'lib/falcon/environment/redirect.rb', line 26 def environments [] end |
#hosts ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/falcon/environment/redirect.rb', line 30 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.
46 47 48 |
# File 'lib/falcon/environment/redirect.rb', line 46 def middleware Middleware::Redirect.new(Middleware::NotFound, hosts, redirect_endpoint) end |
#redirect_endpoint ⇒ Object
20 21 22 |
# File 'lib/falcon/environment/redirect.rb', line 20 def redirect_endpoint Async::HTTP::Endpoint.parse(redirect_url) end |
#redirect_url ⇒ Object
16 17 18 |
# File 'lib/falcon/environment/redirect.rb', line 16 def redirect_url "https://[::]:443" end |