Class: Terminus::Proxy::External
- Inherits:
-
Rack::Proxy
- Object
- Rack::Proxy
- Terminus::Proxy::External
- Defined in:
- lib/terminus/proxy/external.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(uri) ⇒ External
constructor
A new instance of External.
- #rewrite_env(env) ⇒ Object
Constructor Details
#initialize(uri) ⇒ External
Returns a new instance of External.
5 6 7 |
# File 'lib/terminus/proxy/external.rb', line 5 def initialize(uri) @uri = uri end |
Instance Method Details
#call(env) ⇒ Object
17 18 19 20 21 |
# File 'lib/terminus/proxy/external.rb', line 17 def call(env) response = super response[2].extend(Rewrite) response end |
#rewrite_env(env) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/terminus/proxy/external.rb', line 9 def rewrite_env(env) env = env.dup env['SERVER_NAME'] = @uri.host env['SERVER_PORT'] = @uri.port env['HTTP_HOST'] = "#{@uri.host}:#{@uri.port}" env end |