From 02fc7e642060359af2c0fafc0198a8ccdaea2d2d Mon Sep 17 00:00:00 2001 From: Fabian Schindler <fabian.schindler.strauss@gmail.com> Date: Tue, 10 Nov 2020 11:01:12 +0100 Subject: [PATCH] Fixing S3 endpoint URL in GDAL friendly format --- core/registrar/backend.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/registrar/backend.py b/core/registrar/backend.py index d48e64d2..10fd8782 100644 --- a/core/registrar/backend.py +++ b/core/registrar/backend.py @@ -61,9 +61,15 @@ class EOxServerBackend(Backend): 'SECRET_ACCESS_KEY': source.secret_access_key, }) + endpoint_url = source.endpoint_url + if endpoint_url.startswith('https://'): + endpoint_url = endpoint_url[len('https://'):] + elif endpoint_url.startswith('http://'): + endpoint_url = endpoint_url[len('http://'):] + storage_auth, created_storage_auth = backends.StorageAuth.objects.get_or_create( - name=source.endpoint_url, - url=source.endpoint_url, + name=endpoint_url, + url=endpoint_url, storage_auth_type='S3', auth_parameters=params, ) -- GitLab