From 966e8c9db5a3cfc5c8aa49d47d9805a23cdf295e Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Mon, 15 May 2023 00:01:53 -0500 Subject: [PATCH] Fix subdomain download files --- judge/middleware.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/judge/middleware.py b/judge/middleware.py index 1c7f18a..c08b2b9 100644 --- a/judge/middleware.py +++ b/judge/middleware.py @@ -17,6 +17,7 @@ from judge.utils.views import generic_message USED_DOMAINS = ["www"] +URL_NAMES_BYPASS_SUBDOMAIN = ["submission_source_file"] class ShortCircuitMiddleware: @@ -117,7 +118,10 @@ class SubdomainMiddleware(object): subdomain = subdomain[:-1] - if subdomain in USED_DOMAINS: + if ( + subdomain in USED_DOMAINS + or resolve(request.path).url_name in URL_NAMES_BYPASS_SUBDOMAIN + ): return self.get_response(request) try: