Issue #104 resolved

Handle Quoted chars in URLs

Anonymous avatarAnonymous created an issue

Fixed in changeset [158]

Reported by rdelon

Comments (11)

  1. Anonymous

    If you put

        path=path.replace('%20','\x20') # Remove transformed spaces (%20) to real space
    
        # Handle static directories
    

    just above "# Handle static directories" it will work fine

  2. Ivo

    Correction...

    path = urllib.unquote(path) # Replace quoted chars (eg %20) from url
    

    is the better option. Thanx Carlos

  3. Anonymous

    The fix is incomplete.

    The code in question appears twice (yes, code duplication!), and it was only fixed once.

    Lines 315-321 in _cphttptools.py:

        if path.startswith('/'):
            # Remove leading slash
            path = path[1:]
        if path.endswith('/'):
            # Remove trailing slash
            path = path[:-1]
        path = urllib.unquote(path) # Replace quoted chars (eg %20) from url
    

    Lines 478-481 in _cphttptools.py:

        if path.startswith('/'):
            path = path[1:] # Remove leading slash
        if path.endswith('/'):
            path = path[:-1] # Remove trailing slash
    

    URLs should be unquoted in the latter case too.

  4. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.