Ticket #7494: fix_absolute_url_check_in_get_absolute_url.diff
File fix_absolute_url_check_in_get_absolute_url.diff, 890 bytes (added by , 16 years ago) |
---|
-
django/http/__init__.py
1 1 import os 2 import re 2 3 from Cookie import SimpleCookie, CookieError 3 4 from pprint import pformat 4 5 from urllib import urlencode … … 16 17 17 18 RESERVED_CHARS="!*'();:@&=+$,/?%#[]" 18 19 20 absolute_http_url_re = re.compile("^https?://", re.I) 19 21 20 22 class Http404(Exception): 21 23 pass … … 73 75 """ 74 76 if not location: 75 77 location = self.get_full_path() 76 if not ':' in location:78 if not absolute_http_url_re.match(location): 77 79 current_uri = '%s://%s%s' % (self.is_secure() and 'https' or 'http', 78 80 self.get_host(), self.path) 79 81 location = urljoin(current_uri, location)