From f1cf7de7885ae1e0ac0c6492db69e1966c8ffbc5 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Ritschard Date: Wed, 2 Nov 2016 17:07:02 +0100 Subject: [PATCH] fixup! v2 signer: correctly sort headers Signed-off-by: Pierre-Yves Ritschard --- registry/storage/driver/s3-aws/s3_v2_signer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/storage/driver/s3-aws/s3_v2_signer.go b/registry/storage/driver/s3-aws/s3_v2_signer.go index 37e870f6..7cabe07e 100644 --- a/registry/storage/driver/s3-aws/s3_v2_signer.go +++ b/registry/storage/driver/s3-aws/s3_v2_signer.go @@ -153,7 +153,7 @@ func (v2 *signer) Sign() error { default: if strings.HasPrefix(k, "x-amz-") { vall := strings.Join(v, ",") - smap[k] = k+":"+vall + smap[k] = k + ":" + vall if k == "x-amz-date" { xamzDate = true date = "" @@ -164,7 +164,7 @@ func (v2 *signer) Sign() error { } if len(sharray) > 0 { sort.StringSlice(sharray).Sort() - for _, h := range(sharray) { + for _, h := range sharray { sarray = append(sarray, smap[h]) } xamz = strings.Join(sarray, "\n") + "\n"