1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-18 16:36:15 +00:00

use allowed_hosts argument for is_safe_url func

This commit is contained in:
lian
2021-09-30 14:41:02 +08:00
parent 8d4eb7b643
commit 9ded919a2f

View File

@@ -234,7 +234,7 @@ def login_simple_check(request):
# Ensure the user-originating redirection url is safe.
if REDIRECT_FIELD_NAME in request.GET:
next_page = request.GET[REDIRECT_FIELD_NAME]
if not is_safe_url(url=next_page, host=request.get_host()):
if not is_safe_url(url=next_page, allowed_hosts=request.get_host()):
next_page = settings.LOGIN_REDIRECT_URL
else:
next_page = settings.SITE_ROOT