Ticket #6165: patch.2.diff

File patch.2.diff, 862 bytes (added by eratothene, 17 years ago)

Incomplete patch

  • http/__init__.py

    old new class HttpRequest(object):  
    4444        return key in self.GET or key in self.POST
    4545
    4646    __contains__ = has_key
    47 
    48     def get_host(self):
     47   
     48    def _get_host(self):
    4949        "Returns the HTTP host using the environment or request headers."
    5050        # We try three options, in order of decreasing preference.
    5151        if 'HTTP_X_FORWARDED_HOST' in self.META:
    class HttpRequest(object):  
    5959            if server_port != (self.is_secure() and 443 or 80):
    6060                host = '%s:%s' % (host, server_port)
    6161        return host
    62 
     62   
     63    host = property(_get_host)
     64   
     65    def get_host(self):
     66        "DEPRECIATED. Use host property instead"
     67        return self.host
     68   
    6369    def get_full_path(self):
    6470        return ''
    6571
Back to Top