Class: Skypager::Proxy::RequestProxy
- Inherits:
-
Rack::Proxy
- Object
- Rack::Proxy
- Skypager::Proxy::RequestProxy
- Defined in:
- lib/skypager/proxy.rb
Instance Method Summary collapse
Instance Method Details
#cfg ⇒ Object
181 182 183 |
# File 'lib/skypager/proxy.rb', line 181 def cfg @cfg ||= {} end |
#rewrite_env(e) ⇒ Object
185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/skypager/proxy.rb', line 185 def rewrite_env(e) e.tap do |env| current = env['HTTP_HOST'] current_host, current_port = current.split(':') host = cfg[:host].to_s host = host + ":#{ cfg[:port] }" if cfg[:port] Rails.logger.info "replacing #{ current } with #{ host } #{ env['PATH_INFO'] }" env['HTTP_HOST'] = host end end |
#set_config(options = {}) ⇒ Object
176 177 178 179 |
# File 'lib/skypager/proxy.rb', line 176 def set_config ={} cfg.merge!() cfg end |