Class: Tep::Proxy::UpstreamRequest
- Inherits:
-
Object
- Object
- Tep::Proxy::UpstreamRequest
- Defined in:
- lib/tep/proxy.rb
Overview
Mutable descriptor of the outbound request, handed to before_forward so hooks can rewrite verb / path / headers / body before the upstream call. ‘set_header` mirrors Tep::Http#set_header for muscle-memory parity.
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#path ⇒ Object
Returns the value of attribute path.
-
#verb ⇒ Object
Returns the value of attribute verb.
Instance Method Summary collapse
-
#initialize ⇒ UpstreamRequest
constructor
A new instance of UpstreamRequest.
- #set_header(k, v) ⇒ Object
Constructor Details
#initialize ⇒ UpstreamRequest
Returns a new instance of UpstreamRequest.
652 653 654 655 656 657 |
# File 'lib/tep/proxy.rb', line 652 def initialize @verb = "GET" @path = "/" @headers = Tep.str_hash @body = "" end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
650 651 652 |
# File 'lib/tep/proxy.rb', line 650 def body @body end |
#headers ⇒ Object
Returns the value of attribute headers.
650 651 652 |
# File 'lib/tep/proxy.rb', line 650 def headers @headers end |
#path ⇒ Object
Returns the value of attribute path.
650 651 652 |
# File 'lib/tep/proxy.rb', line 650 def path @path end |
#verb ⇒ Object
Returns the value of attribute verb.
650 651 652 |
# File 'lib/tep/proxy.rb', line 650 def verb @verb end |
Instance Method Details
#set_header(k, v) ⇒ Object
659 660 661 |
# File 'lib/tep/proxy.rb', line 659 def set_header(k, v) @headers[k] = v end |