From 9f55626c309fbf140229e87f2bc463761f585b81 Mon Sep 17 00:00:00 2001
From: Luke Faraone <lfaraone@debian.org>
Date: Wed, 10 Aug 2016 19:38:54 +0000
Subject: [PATCH] Add support for IPv6-formatted IPv4 addresses

This implements support for addresses of the form '::ffff:169.254.169.254',
which were previously rejected in error.

Patch provided in https://launchpad.net/bugs/1611923 by LaMont Jones.
---
 django/http/request.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/django/http/request.py b/django/http/request.py
index 1dedf5d..271ab30 100644
--- a/django/http/request.py
+++ b/django/http/request.py
@@ -24,7 +24,7 @@ from django.utils.six.moves.urllib.parse import (
 )
 
 RAISE_ERROR = object()
-host_validation_re = re.compile(r"^([a-z0-9.-]+|\[[a-f0-9]*:[a-f0-9:]+\])(:\d+)?$")
+host_validation_re = re.compile(r"^([a-z0-9.-]+|\[[a-f0-9]*:[a-f0-9\.:]+\])(:\d+)?$")
 
 
 class UnreadablePostError(IOError):
-- 
2.8.1

