Changes between Version 4 and Version 5 of MultiHostMiddleware


Ignore:
Timestamp:
02/19/13 01:00:39 (2 years ago)
Author:
andre@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MultiHostMiddleware

    v4 v5  
    4747            request.META["LoadingStart"] = time.time()
    4848            host = request.META["HTTP_HOST"]
    49             if host[-3:] == ":80":
    50                 host = host[:-3] # ignore default port number, if present
     49            #if host[-3:] == ":80":
     50            #    host = host[:-3] # ignore default port number, if present
     51
     52            # best way to do this.
     53            host = request.META["HTTP_HOST"]
     54            host_port = host.split(':')
     55
     56            if len(host_port)==2:                   
     57                host = host_port[0]
     58
    5159            if settings.HOST_MIDDLEWARE_URLCONF_MAP.has_key(host):
    5260                request.urlconf = settings.HOST_MIDDLEWARE_URLCONF_MAP[host]
Back to Top