Skip to content

Commit

Permalink
Fix IP based hostnames.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericholscher committed Mar 2, 2011
1 parent 03f562f commit 566a22b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion readthedocs/core/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def process_request(self, request):
domain_parts = host.split('.')
#Google was finding crazy www.blah.readthedocs.org domains.
if len(domain_parts) > 3:
raise Http404
if not settings.DEBUG:
raise Http404('Invalid hostname')
if len(domain_parts) == 3:
subdomain = domain_parts[0]
request.slug = subdomain
Expand Down

0 comments on commit 566a22b

Please sign in to comment.