Class: ForwardRequest
- Inherits:
-
Object
- Object
- ForwardRequest
- Includes:
- Interactor
- Defined in:
- app/interactors/forward_request.rb
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'app/interactors/forward_request.rb', line 6 def call return unless forward_url = built_request.try(:[], 'forwardTo') # use the response from the forwarded URL context.built_response = forward_to(built_request, forward_url) rescue => e context.built_response = { 'status' => 500, 'headers' => { 'Content-Type' => 'text/plain' }, 'body' => e. } end |