Skip to content

Commit 9e1bbbe

Browse files
committed
chore: sign copy source uri
1 parent 9d6b5d5 commit 9e1bbbe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/azure_blob/client.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ def get_blob(key, options = {})
8686
def copy_blob(key, source_key, options = {})
8787
uri = generate_uri("#{container}/#{key}")
8888

89+
source_uri = signed_uri(source_key, permissions: "r", expiry: Time.at(Time.now.to_i + 300).utc.iso8601)
90+
8991
headers = {
9092
"Content-Length": 0,
91-
"x-ms-copy-source": generate_uri("#{container}/#{source_key}").to_s,
93+
"x-ms-copy-source": source_uri.to_s,
9294
"x-ms-blob-type": "BlockBlob",
9395
}
9496

0 commit comments

Comments
 (0)