Class: S3::PresignGetRequest

Inherits:
Request
  • Object
show all
Defined in:
lib/s3/presign_get_request.rb

Constant Summary collapse

DEFAULT_EXPIRES_IN =
3600

Constants inherited from Request

Request::AWS_ALGORITHM, Request::AWS_REQUEST, Request::SERVICE, Request::UNSIGNED_PAYLOAD

Instance Method Summary collapse

Methods inherited from Request

#initialize

Constructor Details

This class inherits a constructor from S3::Request

Instance Method Details

#submit(options = nil, bucket:, key:, **kwargs) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/s3/presign_get_request.rb', line 5

def submit( options = nil, bucket:, key:, **kwargs )
  options = merge_options( options, kwargs, PresignGetOptions )

  expires_in = options[ :expires_in ] || DEFAULT_EXPIRES_IN
  path = "/#{ bucket }/#{ Helpers.encode_key( key ) }"

  generate_presigned_url( :get, path, expires_in: expires_in,
                          response_content_type: options[ :response_content_type ],
                          response_content_disposition: options[ :response_content_disposition ] )
end