Skip to content

Commit adadecf

Browse files
authored
Merge pull request #213 from LostKobrakai/patch-1
Update s3.ex
2 parents 104428f + 403cce3 commit adadecf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/ex_aws/s3.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,9 @@ defmodule ExAws.S3 do
12591259
In this case, bucket must be set to a full hostname, for example `mybucket.example.com`.
12601260
The `bucket_as_host` must be passed along with `virtual_host=true`
12611261
1262+
Option param `:start_datetime` can be used to modify the start date for the presigned url, which
1263+
allows for cache friendly urls.
1264+
12621265
Additional (signed) query parameters can be added to the url by setting option param
12631266
`:query_params` to a list of `{"key", "value"}` pairs. Useful if you are uploading parts of
12641267
a multipart upload directly from the browser.
@@ -1300,7 +1303,7 @@ defmodule ExAws.S3 do
13001303

13011304
false ->
13021305
url = url_to_sign(bucket, object, config, virtual_host, bucket_as_host)
1303-
datetime = :calendar.universal_time()
1306+
datetime = Keyword.get(opts, :start_datetime, :calendar.universal_time())
13041307

13051308
ExAws.Auth.presigned_url(
13061309
http_method,

0 commit comments

Comments
 (0)