1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

merge fix

This commit is contained in:
Adolfo Gómez García 2023-04-04 18:57:07 +02:00
parent 139cb1f02f
commit 79b350486a
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23

View File

@ -33,7 +33,7 @@ import logging
import typing
from django.urls import reverse
from django.http import HttpResponseRedirect
from django.http import HttpResponsePermanentRedirect
from uds.core.util.config import GlobalConfig
@ -48,13 +48,7 @@ def _check_redirectable(request: 'HttpRequest') -> typing.Optional['HttpResponse
if request.is_secure():
return None
if request.method == 'POST': # No post redirects
url = reverse('page.login')
else:
url = request.build_absolute_uri(request.get_full_path())
url = url.replace('http://', 'https://')
return HttpResponseRedirect(url)
return HttpResponsePermanentRedirect(reverse('page.login'))
# Compatibility with old middleware, so we can use it in settings.py as it was