class Aws::Plugins::S3RequestSigner::BucketRegionErrorHandler

def update_region_header(context, region)

def update_region_header(context, region)
  context.http_response.body.truncate(0)
  context.http_request.headers.delete('authorization')
  context.http_request.headers.delete('x-amz-security-token')
  context.http_request.endpoint.host = new_hostname(context, region)
  signer = Signers::V4.new(context.config.credentials, 's3', region)
  signer.sign(context.http_request)
end