Sha256: abba4551c71b1b2fd1ecc280aa1d0e7567044f9f3fc0eb6aa91775c9f5b42aec
Contents?: true
Size: 1.12 KB
Versions: 65
Compression:
Stored size: 1.12 KB
Contents
module Aws module S3 module Plugins class Redirects < Seahorse::Client::Plugin option(:follow_redirects, default: true, doc_type: 'Boolean', docstring: <<-DOCS) When `true`, this client will follow 307 redirects returned by Amazon S3. DOCS # @api private class Handler < Seahorse::Client::Handler def call(context) response = @handler.call(context) if context.http_response.status_code == 307 endpoint = context.http_response.headers['location'] unless context.http_request.endpoint.host.include?('fips') context.http_request.endpoint = endpoint end context.http_response.body.truncate(0) @handler.call(context) else response end end end def add_handlers(handlers, config) if config.follow_redirects # we want to re-trigger request signing handlers.add(Handler, step: :sign, priority: 90) end end end end end end
Version data entries
65 entries across 65 versions & 1 rubygems