Hack for minio bucket detection

This commit is contained in:
Tris 2020-10-05 10:30:47 +11:00
parent f0a942dfc6
commit 8e50cf711e

View File

@ -98,7 +98,9 @@ class S3CompleteView(SingleObjectMixin, RedirectView):
self.complete(request.GET['key'])
elif 'location' in request.GET:
uri = urlparse(request.GET['location'])
_bucket, key = uri.path[1:].split('/', 1)
bucket, key = uri.path[1:].split('/', 1)
if bucket != models.BUCKET:
key = uri.path[1:]
self.complete(key)
else:
raise KeyError("No key or location found")