Django

Code

Changeset 8456

Show
Ignore:
Timestamp:
08/20/08 20:32:18 (3 months ago)
Author:
mtredinnick
Message:

Fixed #8381 -- Fixed a problem with appending slashes in the common middleware
when SCRIPT_NAME contains something other than '/'. Patch from jcassee.

Also fixed the middleware tests to work with this patch.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/middleware/common.py

    r8193 r8456  
    5555        if settings.APPEND_SLASH and (not old_url[1].endswith('/')): 
    5656            try: 
    57                 urlresolvers.resolve(request.path
     57                urlresolvers.resolve(request.path_info
    5858            except urlresolvers.Resolver404: 
    5959                new_url[1] = new_url[1] + '/' 
     
    7070            # Redirect if the target url exists 
    7171            try: 
    72                 urlresolvers.resolve(new_url[1]
     72                urlresolvers.resolve("%s/" % request.path_info
    7373            except urlresolvers.Resolver404: 
    7474                pass 
  • django/trunk/tests/regressiontests/middleware/tests.py

    r7294 r8456  
    1313            'SERVER_PORT': 80, 
    1414        } 
    15         request.path = "/middleware/%s" % path 
     15        request.path = request.path_info = "/middleware/%s" % path 
    1616        return request 
    1717