From 89af6eecf4b6931313691f93b0b608f68fdad6c6 Mon Sep 17 00:00:00 2001
From: Todd Dembrey <todd.dembrey@torchbox.com>
Date: Thu, 6 Sep 2018 17:49:14 +0100
Subject: [PATCH] Dont screw up the scheme

---
 opentech/storage_backends.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/opentech/storage_backends.py b/opentech/storage_backends.py
index 82b84f92e..0e0bf2664 100644
--- a/opentech/storage_backends.py
+++ b/opentech/storage_backends.py
@@ -27,7 +27,7 @@ class PrivateMediaStorage(S3Boto3Storage):
     encryption = True
     file_overwrite = False
     querystring_auth = True
-    url_protocol = 'https:'
+    secure_urls = True
 
     def url(self, name, parameters=None, expire=None):
         url = super().url(name, parameters, expire)
@@ -36,7 +36,7 @@ class PrivateMediaStorage(S3Boto3Storage):
             # Django storage doesn't handle custom domains with auth strings
             custom_domain = settings.AWS_PRIVATE_CUSTOM_DOMAIN
             parts = list(parse.urlsplit(url))
-            parts[0:3] = self.url_protocol, custom_domain, filepath_to_uri(name)
+            parts[1:3] = custom_domain, filepath_to_uri(name)
             return parse.urlunsplit(parts)
 
         return url
-- 
GitLab