diff --git a/django/core/validators.py b/django/core/validators.py
index b1b82db..2fd1253 100644
a
|
b
|
class URLValidator(RegexValidator):
|
73 | 73 | |
74 | 74 | if self.verify_exists: |
75 | 75 | import urllib2 |
| 76 | class HeadRequest(urllib2.Request): |
| 77 | def get_method(self): |
| 78 | return "HEAD" |
76 | 79 | headers = { |
77 | 80 | "Accept": "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5", |
78 | 81 | "Accept-Language": "en-us,en;q=0.5", |
… |
… |
class URLValidator(RegexValidator):
|
81 | 84 | "User-Agent": self.user_agent, |
82 | 85 | } |
83 | 86 | try: |
84 | | req = urllib2.Request(url, None, headers) |
| 87 | req = HeadRequest(url, None, headers) |
85 | 88 | u = urllib2.urlopen(req) |
86 | 89 | except ValueError: |
87 | 90 | raise ValidationError(_(u'Enter a valid URL.'), code='invalid') |