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 tom@…, 7 years ago)

Patch that fixes the problem

  • django/http/__init__.py

     
    11import os
     2import re
    23from Cookie import SimpleCookie, CookieError
    34from pprint import pformat
    45from urllib import urlencode
     
    1617
    1718RESERVED_CHARS="!*'();:@&=+$,/?%#[]"
    1819
     20absolute_http_url_re = re.compile("^https?://", re.I)
    1921
    2022class Http404(Exception):
    2123    pass
     
    7375        """
    7476        if not location:
    7577            location = self.get_full_path()
    76         if not ':' in location:
     78        if not absolute_http_url_re.match(location):           
    7779            current_uri = '%s://%s%s' % (self.is_secure() and 'https' or 'http',
    7880                                         self.get_host(), self.path)
    7981            location = urljoin(current_uri, location)
Back to Top