Changeset f7cd67 in indico


Ignore:
Timestamp:
04/05/11 11:46:10 (2 years ago)
Author:
Pedro Ferreira <jose.pedro.ferreira@…>
Branches:
master, burotel, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 0da0c1403bae8e51d8229f460181c71b9e6dda72
Children:
cf4381
Parents:
21f3fc
Message:

[FIX] short urls now accept trailing slashes

  • Not best solution, though - regexp should have probably been used;
  • We need to sort out this WSGIRedirect thing, as it does no actual redirect;
File:
1 edited

Legend:

Unmodified
Added
Removed
  • indico/web/wsgi/indico_wsgi_url_parser.py

    ra691b3 rf7cd67  
    100100class WSGIRedirection(object): 
    101101    """ 
    102     Redirections that need a especial treatment are handled through this class. 
     102    Redirections that need special treatment are handled by this class. 
    103103    """ 
    104104    def __init__(self, req, module, handler, dir): 
     
    129129        """ 
    130130        newQueryString = query + '=' 
    131         newQueryString += '/'.join(self._path[self._index+1:]) 
     131 
     132        # remove trailing slashes 
     133        filteredPath = self._path[self._index + 1:] 
     134        if filteredPath[-1] == '': 
     135            filteredPath = filteredPath[:-1] 
     136 
     137        newQueryString += '/'.join(filteredPath) 
     138 
    132139        if self._req.URLFields['QUERY_STRING']: 
    133140            newQueryString += '?' + self._req.URLFields['QUERY_STRING'] 
Note: See TracChangeset for help on using the changeset viewer.