Reduce re.match to official name only

This commit is contained in:
Nico Schottelius 2019-02-05 15:11:00 +01:00
parent 243e10d809
commit 32ac399c7f

View file

@ -18,7 +18,7 @@ class IndexView(TemplateView):
back_to_url = self.request.GET["back_to"]
elif 'HTTP_HOST' in self.request.META:
# Exclude ourselves
if not re.match("^(no-ipv4-here.ungleich.ch|localhost)", self.request.META['HTTP_HOST']):
if not re.match("^no-ipv4-here.ungleich.ch", self.request.META['HTTP_HOST']):
back_to_url = "http://{}".format(self.request.META['HTTP_HOST'])
context['back_to_url'] = back_to_url
if back_to_url != "":