Method: FaradayMiddleware::FollowRedirects#initialize
- Defined in:
- lib/faraday_middleware/response/follow_redirects.rb
#initialize(app, options = {}) ⇒ FollowRedirects
Public: Initialize the middleware.
options - An options Hash (default: {}):
:limit - A Numeric redirect limit (default: 3)
:standards_compliant - A Boolean indicating whether to respect
the HTTP spec when following 301/302
(default: false)
55 56 57 58 59 60 61 |
# File 'lib/faraday_middleware/response/follow_redirects.rb', line 55 def initialize(app, = {}) super(app) @options = @convert_to_get = Set.new [303] @convert_to_get << 301 << 302 unless standards_compliant? end |