diff --git a/storages/backends/gcloud.py b/storages/backends/gcloud.py index 77b3e144..de43cf7d 100644 --- a/storages/backends/gcloud.py +++ b/storages/backends/gcloud.py @@ -127,7 +127,7 @@ def get_default_settings(self): "location": setting("GS_LOCATION", ""), "default_acl": setting("GS_DEFAULT_ACL"), "querystring_auth": setting("GS_QUERYSTRING_AUTH", True), - "expiration": setting("GS_EXPIRATION", timedelta(seconds=86400)), + "expiration": setting("GS_EXPIRATION", timedelta(seconds=31536000)), "gzip": setting("GS_IS_GZIPPED", False), "gzip_content_types": setting( "GZIP_CONTENT_TYPES", @@ -330,9 +330,13 @@ def url(self, name, parameters=None): quoted_name=_quote(name, safe=b"/~"), ) elif not self.custom_endpoint: - return blob.generate_signed_url(**self.signed_url_extra()) + return blob.generate_signed_url( + expiration=self.expiration, + **self.signed_url_extra() + ) else: return blob.generate_signed_url( + expiration=self.expiration, api_access_endpoint=self.custom_endpoint, **self.signed_url_extra() )