]> granicus.if.org Git - python/commitdiff
Let cgi.parse_header() properly unquote headers (patch #1008597).
authorJohannes Gijsbers <jlg@dds.nl>
Sat, 14 Aug 2004 15:39:34 +0000 (15:39 +0000)
committerJohannes Gijsbers <jlg@dds.nl>
Sat, 14 Aug 2004 15:39:34 +0000 (15:39 +0000)
Lib/cgi.py

index 7c3d6579434ff2cd78db0593d3630395a9456003..fb40ed36a3c11d5aee7229a8801fda3d1b034c41 100755 (executable)
@@ -338,6 +338,7 @@ def parse_header(line):
             value = p[i+1:].strip()
             if len(value) >= 2 and value[0] == value[-1] == '"':
                 value = value[1:-1]
+                value = value.replace('\\\\', '\\').replace('\\"', '"')
             pdict[name] = value
     return key, pdict