Skip to content

Commit

Permalink
Swift signed urls must not end with \n
Browse files Browse the repository at this point in the history
  • Loading branch information
mvach committed Sep 18, 2024
1 parent b5bda88 commit 54ea437
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ var _ = Describe("S3CompatibleClient", func() {
urlRegexp =
"https://host-name/v1/swift_account/some-bucket/test-object-id" +
`\?temp_url_sig=([a-f0-9]+)` +
`&temp_url_expires=([0-9]+)` +
"\n"
`&temp_url_expires=([0-9]+)`
})

Context("when the action is GET", func() {
Expand Down
2 changes: 1 addition & 1 deletion client/openstack_swift_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (c *openstackSwiftS3Client) signedURL(action string, objectID string, expir
h.Write([]byte(hmacBody))
signature := hex.EncodeToString(h.Sum(nil))

url := fmt.Sprintf("https://%s%s?temp_url_sig=%s&temp_url_expires=%d\n", c.s3cliConfig.Host, path, signature, expires)
url := fmt.Sprintf("https://%s%s?temp_url_sig=%s&temp_url_expires=%d", c.s3cliConfig.Host, path, signature, expires)

return url, nil
}

0 comments on commit 54ea437

Please sign in to comment.