1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-01-24 02:04:09 +03:00

Changed redirection from redirect to permanent redirect on HTTP use

This commit is contained in:
Adolfo Gómez García 2023-04-04 18:55:05 +02:00
parent 59d578f292
commit 321255a1b0
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23

View File

@ -29,7 +29,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
logger = logging.getLogger(__name__)
@ -86,7 +86,7 @@ class RedirectMiddleware:
url = request.build_absolute_uri(full_path)
url = url.replace('http://', 'https://')
return HttpResponseRedirect(url)
return HttpResponsePermanentRedirect(url)
return self.get_response(request)
@staticmethod