class Aws::Plugins::EC2CopyEncryptedSnapshot::PresignHandler
@api private
* The url-encoded body is moved to the querystring
* The HTTP method is changed from POST to GET
Before signing:
and returns it as the response data.
the stack. It generates a presigned url from the request
This handler intentionally does NOT call the next handler in
def call(context)
def call(context) convert_post_2_get(context) Seahorse::Client::Response.new( context: context, data: presigned_url(context.http_request, context.config)) end
def convert_post_2_get(context)
def convert_post_2_get(context) context.http_request.http_method = 'GET' context.http_request.endpoint = new_endpoint(context) context.http_request.body = '' context.http_request.headers.delete('Content-Type') end
def new_endpoint(context)
def new_endpoint(context) body = context.http_request.body_contents endpoint = context.http_request.endpoint endpoint.query = body endpoint end
def presigned_url(http_request, config)
def presigned_url(http_request, config) signer = Signers::V4.new(config.credentials, 'ec2', config.region) signer.presigned_url(http_request, expires_in: 3600) end