Class: Html2rss::RequestService::FaradayStrategy
- Defined in:
- lib/html2rss/request_service/faraday_strategy.rb
Overview
Strategy to use Faraday for the request.
Defined Under Namespace
Classes: StreamingBodyMiddleware
Instance Method Summary collapse
-
#execute ⇒ Response
NOTE: Unlike BrowserlessStrategy, Faraday does not expose the remote IP after connect.
Methods inherited from Strategy
Constructor Details
This class inherits a constructor from Html2rss::RequestService::Strategy
Instance Method Details
#execute ⇒ Response
NOTE: Unlike BrowserlessStrategy, Faraday does not expose the remote IP after connect. SSRF protection here is pre-connection only (DNS resolution via Policy). A DNS rebinding attack between resolution and connect cannot be caught at this layer.
Executes a request with runtime policy enforcement.
34 35 36 37 38 39 40 41 |
# File 'lib/html2rss/request_service/faraday_strategy.rb', line 34 def execute deadline = request_deadline response_guard, response = perform_request(deadline:) response_guard.inspect_body!(response.body) build_response(response) rescue Faraday::TimeoutError, Timeout::Error => error raise RequestTimedOut, error. end |