Merge branch 'LQDJudge:master' into master

This commit is contained in:
Dung T.Bui 2023-05-16 12:47:53 +07:00 committed by GitHub
commit 49a186f72f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 132 additions and 90 deletions

View file

@ -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: