Ignore:
Timestamp:
Mar 19, 2014, 11:11:30 AM (11 years ago)
Author:
dmik
Message:

python: Update vendor to 2.7.6.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/vendor/current/Lib/SimpleHTTPServer.py

    r2 r388  
    1616import urllib
    1717import cgi
     18import sys
    1819import shutil
    1920import mimetypes
     
    132133        f.seek(0)
    133134        self.send_response(200)
    134         self.send_header("Content-type", "text/html")
     135        encoding = sys.getfilesystemencoding()
     136        self.send_header("Content-type", "text/html; charset=%s" % encoding)
    135137        self.send_header("Content-Length", str(length))
    136138        self.end_headers()
     
    148150        path = path.split('?',1)[0]
    149151        path = path.split('#',1)[0]
     152        # Don't forget explicit trailing slash when normalizing. Issue17324
     153        trailing_slash = path.rstrip().endswith('/')
    150154        path = posixpath.normpath(urllib.unquote(path))
    151155        words = path.split('/')
     
    157161            if word in (os.curdir, os.pardir): continue
    158162            path = os.path.join(path, word)
     163        if trailing_slash:
     164            path += '/'
    159165        return path
    160166
Note: See TracChangeset for help on using the changeset viewer.