浏览代码

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

ayush.goyal 4 年之前
父节点
当前提交
bd6ffc6755
共有 1 个文件被更改,包括 1 次插入1 次删除
  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/']: