Changeset 69

Show
Ignore:
Timestamp:
05/23/07 11:47:28 (20 months ago)
Author:
steadicat
Message:

Added support for running in the test suite

Files:
1 modified

Legend:

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

    r8 r69  
    2323Changelog 
    2424 
     251.3.1 
     26Added support for running in a test suite (doesn't assume that 
     27HTTP_HOST is set) 
     28 
    25291.3 
    2630Only use sessions for the language preference if the session 
     
    4044First release. 
    4145""" 
    42 __version__ = "1.3" 
     46__version__ = "1.3.1" 
    4347__license__ = "Python" 
    44 __copyright__ = "Copyright (C) 2006, Stefano J. Attardi" 
     48__copyright__ = "Copyright (C) 2006-2007, Stefano J. Attardi" 
    4549__author__ = "Stefano J. Attardi <http://attardi.org/>" 
    4650__contributors__ = ["Antonio Cavedoni <http://cavedoni.com/>"] 
     
    6468 
    6569        # Check for a redirect based on settings.APPEND_SLASH and settings.PREPEND_WWW 
    66         old_url = [request.META['HTTP_HOST'], request.path] 
     70        old_url = [request.META.get('HTTP_HOST', 'localhost'), request.path] 
    6771        new_url = old_url[:] 
    6872