]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Remove disabled code, and test for backslash removal. 869/head
authorMartin von Gagern <Martin.vGagern@gmx.net>
Wed, 28 Aug 2013 20:41:53 +0000 (22:41 +0200)
committerMartin von Gagern <Martin.vGagern@gmx.net>
Wed, 28 Aug 2013 20:41:53 +0000 (22:41 +0200)
tornado/httputil.py

index e5b42d8def61a3c410033640323430ac66963c79..8ccf8a75728fd68f1bd575469fa838d2930e9d35 100644 (file)
@@ -424,11 +424,12 @@ def _parse_header(line):
 
     Return the main content-type and a dictionary of options.
 
-    >>> d = _parse_header("CD: fd; foo=\"bar\"; file*=utf-8''T%C3%A4st")[1]
+    >>> d = "CD: fd; foo=\"b\\\\a\\\"r\"; file*=utf-8''T%C3%A4st"
+    >>> d = _parse_header(d)[1]
     >>> d['file'] == r'T\u00e4st'.encode('ascii').decode('unicode_escape')
     True
     >>> d['foo']
-    'bar'
+    'b\\a"r'
     """
     parts = _parseparam(';' + line)
     key = next(parts)
@@ -439,9 +440,6 @@ def _parse_header(line):
         if i >= 0:
             name = p[:i].strip().lower()
             value = p[i + 1:].strip()
-            if len(value) >= 2 and value[0] == value[-1] == '"' and False:
-                value = value[1:-1]
-                value = value.replace('\\\\', '\\').replace('\\"', '"')
             params.append((name, value))
     params = email.utils.decode_params(params)
     params.pop(0) # get rid of the dummy again