Ticket #14941: urlvalidator.diff
File urlvalidator.diff, 585 bytes (added by , 14 years ago) |
---|
-
django/core/validators.py
diff --git a/django/core/validators.py b/django/core/validators.py index b1b82db..65a980b 100644
a b class URLValidator(RegexValidator): 81 81 "User-Agent": self.user_agent, 82 82 } 83 83 try: 84 req = urllib2.Request(url , None, headers)84 req = urllib2.Request(url.encode('utf-8'), None, headers) 85 85 u = urllib2.urlopen(req) 86 86 except ValueError: 87 87 raise ValidationError(_(u'Enter a valid URL.'), code='invalid')