Fix subdomain download files

This commit is contained in:
cuom1999 2023-05-15 00:01:53 -05:00
parent ad974530d5
commit 966e8c9db5

View file

@ -17,6 +17,7 @@ from judge.utils.views import generic_message
USED_DOMAINS = ["www"] USED_DOMAINS = ["www"]
URL_NAMES_BYPASS_SUBDOMAIN = ["submission_source_file"]
class ShortCircuitMiddleware: class ShortCircuitMiddleware:
@ -117,7 +118,10 @@ class SubdomainMiddleware(object):
subdomain = subdomain[:-1] 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) return self.get_response(request)
try: try: