Class: Aws::S3::Plugins::Redirects::Handler Private

Inherits:
Seahorse::Client::Handler
  • Object
show all
Defined in:
lib/aws-sdk-s3/plugins/redirects.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#call(context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/aws-sdk-s3/plugins/redirects.rb', line 19

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