[BUG] merge IE11 signature fix

This commit is contained in:
Matthew Fettig
2014-06-02 09:16:48 -07:00
parent d104ebb6f5
commit 01e38ed4ca

View File

@@ -361,11 +361,19 @@ Crypt.getStringToSign = function(config, parsed, date, mechanism) {
// Sort the properties of the JSON object into canonical form
var canonicalData = JSON.stringify(copyObjectWithSortedKeys(config.data));
// We're using URL parsing using browser functionality. Unfortunately the
// parsing result slightly differs in IE - it is missing a leading slash.
// XXX Proper fix would be to use a pure JS URL parser.
var pathname = parsed.pathname;
// IE11 Workaround
if (pathname[0] !== '/') pathname = '/' + pathname;
// Canonical request using Amazon's v4 signature format
// See: http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
var canonicalRequest = [
config.method || 'GET',
parsed.pathname || '',
pathname || '',
parsed.search || '',
// XXX Headers signing not supported
'',