From 4533e0485017f0d21ffdafa7dba41e20e749b99d Mon Sep 17 00:00:00 2001 From: youngS Date: Thu, 30 Sep 2021 16:15:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9F=9F=E5=90=8D=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fir_ser/api/views/download.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fir_ser/api/views/download.py b/fir_ser/api/views/download.py index 41467cb..6d58e76 100644 --- a/fir_ser/api/views/download.py +++ b/fir_ser/api/views/download.py @@ -150,7 +150,9 @@ class ShortDownloadView(APIView): res = check_app_permission(app_obj, res) if res.code != 1000: return Response(res.dict) - origin_domain_name = request.META.get('HTTP_ORIGIN', 'xx').split('//')[-1] + origin_domain_name = request.META.get('HTTP_ORIGIN', + request.META.get('HTTP_REFERER', + 'http://xxx/xxx')).split('//')[-1].split('/')[0] domain_name = get_redirect_server_domain(request, app_obj.user_id, get_app_domain_name(app_obj)) if not check_app_domain_name_access(app_obj, origin_domain_name, domain_name.split('//')[-1]): res.code = 1004