Class: Rack::StreamingProxy::Request
- Inherits:
-
Object
- Object
- Rack::StreamingProxy::Request
- Defined in:
- lib/rack/streaming_proxy/request.rb
Instance Attribute Summary collapse
-
#http_request ⇒ Object
readonly
Returns the value of attribute http_request.
-
#rack_request ⇒ Object
readonly
Returns the value of attribute rack_request.
Instance Method Summary collapse
- #host ⇒ Object
-
#initialize(destination_uri, current_request) ⇒ Request
constructor
A new instance of Request.
- #port ⇒ Object
- #uri ⇒ Object
- #use_basic_auth? ⇒ Boolean
- #use_ssl? ⇒ Boolean
Constructor Details
#initialize(destination_uri, current_request) ⇒ Request
Returns a new instance of Request.
8 9 10 11 12 |
# File 'lib/rack/streaming_proxy/request.rb', line 8 def initialize(destination_uri, current_request) @destination_uri = URI.parse(destination_uri) @rack_request = current_request @http_request = translate_request(current_request, @destination_uri) end |
Instance Attribute Details
#http_request ⇒ Object (readonly)
Returns the value of attribute http_request.
6 7 8 |
# File 'lib/rack/streaming_proxy/request.rb', line 6 def http_request @http_request end |
#rack_request ⇒ Object (readonly)
Returns the value of attribute rack_request.
6 7 8 |
# File 'lib/rack/streaming_proxy/request.rb', line 6 def rack_request @rack_request end |
Instance Method Details
#host ⇒ Object
14 15 16 |
# File 'lib/rack/streaming_proxy/request.rb', line 14 def host @destination_uri.host end |
#port ⇒ Object
18 19 20 |
# File 'lib/rack/streaming_proxy/request.rb', line 18 def port @destination_uri.port end |
#uri ⇒ Object
30 31 32 |
# File 'lib/rack/streaming_proxy/request.rb', line 30 def uri @destination_uri.to_s end |
#use_basic_auth? ⇒ Boolean
26 27 28 |
# File 'lib/rack/streaming_proxy/request.rb', line 26 def use_basic_auth? @destination_uri.user && @destination_uri.password end |
#use_ssl? ⇒ Boolean
22 23 24 |
# File 'lib/rack/streaming_proxy/request.rb', line 22 def use_ssl? @destination_uri.is_a? URI::HTTPS end |