Class: Tep::Proxy::UpstreamRequest

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeUpstreamRequest

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

#bodyObject

Returns the value of attribute body.



650
651
652
# File 'lib/tep/proxy.rb', line 650

def body
  @body
end

#headersObject

Returns the value of attribute headers.



650
651
652
# File 'lib/tep/proxy.rb', line 650

def headers
  @headers
end

#pathObject

Returns the value of attribute path.



650
651
652
# File 'lib/tep/proxy.rb', line 650

def path
  @path
end

#verbObject

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