Skip to content

Commit

Permalink
Fix: empty body SHA is incorrect.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Mar 26, 2024
1 parent d38bdc1 commit be7407b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion signer/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const OpenSearchService = "es"
const OpenSearchServerless = "aoss"

//nolint:gosec // static empty Body
const emptyBodySHA256 = "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"
const emptyBodySHA256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"

// Signer is an interface that will implement opensearchtransport.Signer
type Signer struct {
Expand Down
2 changes: 1 addition & 1 deletion signer/aws/aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TestV4Signer(t *testing.T) {
q := req.Header
assert.NotEmpty(t, q.Get("Authorization"))
assert.NotEmpty(t, q.Get("X-Amz-Date"))
assert.Equal(t, "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", q.Get("X-Amz-Content-Sha256"))
assert.Equal(t, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", q.Get("X-Amz-Content-Sha256"))
})

t.Run("sign request success with body", func(t *testing.T) {
Expand Down

0 comments on commit be7407b

Please sign in to comment.