Check if host header is present and set back_to_url accordingly
This commit is contained in:
parent
c098d7a497
commit
406c785233
1 changed files with 2 additions and 0 deletions
|
@ -7,6 +7,8 @@ def index(request):
|
||||||
back_to_url = ""
|
back_to_url = ""
|
||||||
if "back_to" in request.GET:
|
if "back_to" in request.GET:
|
||||||
back_to_url = request.GET["back_to"]
|
back_to_url = request.GET["back_to"]
|
||||||
|
elif 'HTTP_HOST' in request.META:
|
||||||
|
back_to_url = request.META['HTTP_HOST']
|
||||||
if back_to_url != "":
|
if back_to_url != "":
|
||||||
return HttpResponse(
|
return HttpResponse(
|
||||||
"""Sorry, <a href="{domain}">this part of domain</a> is not reachable by IPv4.
|
"""Sorry, <a href="{domain}">this part of domain</a> is not reachable by IPv4.
|
||||||
|
|
Loading…
Reference in a new issue