From 801aaa883e1085d4500b68d857112901102a6986 Mon Sep 17 00:00:00 2001 From: Frederick Cheung Date: Fri, 29 Nov 2013 16:29:26 +0000 Subject: [PATCH] [AWS|Storage] fixed signed urls when using session tokens the session token needs to be added to the signature as a header (as well as being included in the query string) --- lib/fog/aws/storage.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/fog/aws/storage.rb b/lib/fog/aws/storage.rb index 6a6178e00..accf32f96 100644 --- a/lib/fog/aws/storage.rb +++ b/lib/fog/aws/storage.rb @@ -140,6 +140,10 @@ module Fog def signed_url(params, expires) expires = expires.to_i + if @aws_session_token + params[:headers]||= {} + params[:headers]['x-amz-security-token'] = @aws_session_token + end signature = signature(params, expires) params = request_params(params)