mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-22 13:34:04 +03:00
merge fix
This commit is contained in:
parent
139cb1f02f
commit
79b350486a
@ -33,7 +33,7 @@ import logging
|
|||||||
import typing
|
import typing
|
||||||
|
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.http import HttpResponseRedirect
|
from django.http import HttpResponsePermanentRedirect
|
||||||
|
|
||||||
from uds.core.util.config import GlobalConfig
|
from uds.core.util.config import GlobalConfig
|
||||||
|
|
||||||
@ -48,13 +48,7 @@ def _check_redirectable(request: 'HttpRequest') -> typing.Optional['HttpResponse
|
|||||||
if request.is_secure():
|
if request.is_secure():
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if request.method == 'POST': # No post redirects
|
return HttpResponsePermanentRedirect(reverse('page.login'))
|
||||||
url = reverse('page.login')
|
|
||||||
else:
|
|
||||||
url = request.build_absolute_uri(request.get_full_path())
|
|
||||||
url = url.replace('http://', 'https://')
|
|
||||||
|
|
||||||
return HttpResponseRedirect(url)
|
|
||||||
|
|
||||||
|
|
||||||
# Compatibility with old middleware, so we can use it in settings.py as it was
|
# Compatibility with old middleware, so we can use it in settings.py as it was
|
||||||
|
Loading…
Reference in New Issue
Block a user