Changeset 49

Show
Ignore:
Timestamp:
10/10/06 12:06:30 (2 years ago)
Author:
verbosus
Message:

Edited SSL middleware to use django.http.get_host(request) instead of request.metaHTTP_HOST?: get_host takes into account also HTTP_X_FORWARDED_HOST. Thanks, mukappa!

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • django/trunk/middleware/sslmiddleware.py

    r48 r49  
    2222from django.conf import settings 
    2323from django.http import HttpResponseRedirect 
     24from django.http import get_host 
    2425 
    2526class SSLMiddleware: 
     
    4344    def _redirect(self, request, protocol): 
    4445        newurl = "%s://%s%s" % \ 
    45             (protocol, request.META['HTTP_HOST'], request.path) 
     46            (protocol, get_host(request), request.path) 
    4647        if request.GET: 
    4748            newurl += '?' + request.GET.urlencode()