Skip to content

Commit

Permalink
samples: don't use USA formatted dates for expiry (#396)
Browse files Browse the repository at this point in the history
* samples: don't use USA formatted dates for expiry

Found via https://twitter.com/iaincollins/status/1040247045246930946
"I ran into the Google Cloud SDK documentation (and code examples!) using MM-DD-YYYY yesterday"

Docs state:
"A timestamp when this policy will expire. Any value given is passed to new Date()."

* Update files.js
  • Loading branch information
broady authored and JustinBeckwith committed Sep 16, 2018
1 parent 8b73cfc commit 287063f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion samples/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ function generateSignedUrl(bucketName, filename) {
// These options will allow temporary read access to the file
const options = {
action: 'read',
expires: '03-17-2025',
expires: Date.now() + 1000 * 60 * 60, // one hour
};

// Get a signed URL for the file
Expand Down

0 comments on commit 287063f

Please sign in to comment.