Skip to content

Commit 1afe3ad

Browse files
committed
Raise 404 Error at SubdomainMiddleware if the project does not exist
1 parent df85fef commit 1afe3ad

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

readthedocs/core/middleware.py

+2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ def process_request(self, request):
6969
# Support ports during local dev
7070
public_domain in host or public_domain in full_host
7171
):
72+
if Project.objects.filter(slug=subdomain).exists():
73+
raise Http404(_('Project not found'))
7274
request.subdomain = True
7375
request.slug = subdomain
7476
request.urlconf = SUBDOMAIN_URLCONF

0 commit comments

Comments
 (0)