﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21921	host_validation_re does not match IPv6 addresses	sej854+django@…	nobody	"Validation of the host part fails, falsely raising SuspiciousOperation

validate_host() or split_domain_port() in django.http.request try to match the Host: value against the following RegExp:

host_validation_re = re.compile(r""^([a-z0-9.-]+|\[[a-f0-9]*:[a-f0-9:]+\])(:\d+)?$"")

The issue are the \[ \] (literal square brackets) around the IPv6 part -- the Host: value actually does not contain them. Hence it fails to match any IPv6 address.
In my local installation I removed the source of the problem by adding question marks after the \[ and \], but of course it'd be better if it could be fixed properly in the code base.

I encountered this problem in a django 1.3.7 install, but checked the github (https://github.com/django/django/blob/c250f9c99b59bb011dae9bc97783458621462b65/django/http/request.py) to confirm that this problem hasn't changed.

Let me know if you need any additional information."	Bug	closed	HTTP handling	dev	Normal	duplicate			Unreviewed	0	0	0	0	0	0
