File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -430,7 +430,7 @@ def get_default_settings(self):
430
430
"image/svg+xml" ,
431
431
),
432
432
),
433
- "url_protocol" : setting ("AWS_S3_URL_PROTOCOL" , "https:" ) ,
433
+ "url_protocol" : setting ("AWS_S3_URL_PROTOCOL" ) or "https:" ,
434
434
"endpoint_url" : setting ("AWS_S3_ENDPOINT_URL" ),
435
435
"proxies" : setting ("AWS_S3_PROXIES" ),
436
436
"region_name" : setting ("AWS_S3_REGION_NAME" ),
Original file line number Diff line number Diff line change @@ -719,6 +719,14 @@ def test_url_unsigned(self):
719
719
self .storage .url ("test_name" )
720
720
self .storage .unsigned_connection .meta .client .generate_presigned_url .assert_called_once ()
721
721
722
+ def test_url_protocol (self ):
723
+ self .assertFalse (hasattr (settings , "AWS_S3_URL_PROTOCOL" ))
724
+ self .assertEqual (self .storage .url_protocol , "https:" )
725
+
726
+ with override_settings (AWS_S3_URL_PROTOCOL = None ):
727
+ storage = s3 .S3Storage ()
728
+ self .assertEqual (storage .url_protocol , "https:" )
729
+
722
730
@mock .patch ("storages.backends.s3.datetime" )
723
731
def test_storage_url_custom_domain_signed_urls (self , dt ):
724
732
key_id = "test-key"
You can’t perform that action at this time.
0 commit comments