Explorar o código

HUE-9682 [Django Upgrade] RemovedInDjango21Warning: The host argument is deprecated, use allowed_hosts instead

ayush.goyal %!s(int64=4) %!d(string=hai) anos
pai
achega
bd6ffc6755
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      desktop/core/src/desktop/middleware.py

+ 1 - 1
desktop/core/src/desktop/middleware.py

@@ -826,7 +826,7 @@ class EnsureSafeRedirectURLMiddleware(MiddlewareMixin):
       if any(regexp.match(location) for regexp in redirection_patterns):
         return response
 
-      if is_safe_url(location, request.get_host()):
+      if is_safe_url(location, allowed_hosts={request.get_host()}):
         return response
 
       if request.path in ['/oidc/authenticate/', '/oidc/callback/', '/oidc/logout/', '/hue/oidc_failed/']: