Method: Github::Response::FollowRedirects#initialize
- Defined in:
- lib/github_api/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)
:callback - A callable that will be called on redirects
with the old and new envs
63 64 65 66 67 68 69 |
# File 'lib/github_api/response/follow_redirects.rb', line 63 def initialize(app, = {}) super(app) @options = @convert_to_get = Set.new [303] @convert_to_get << 301 << 302 unless standards_compliant? end |