Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > eaa160db7b767ede93ef53b32ca2b857 > files > 1

dpkt-1.7-2.fc13.src.rpm

Index: dpkt/http.py
===================================================================
--- dpkt/http.py	(revision 72)
+++ dpkt/http.py	(revision 73)
@@ -15,11 +15,11 @@
         line = line.strip()
         if not line:
             break
-        l = line.split(None, 1)
-        if not l[0].endswith(':'):
+        l = line.split(':', 1)
+        if len(l[0].split()) != 1:
             raise dpkt.UnpackError('invalid header: %r' % line)
-        k = l[0][:-1].lower()
-        v = len(l) != 1 and l[1] or ''
+        k = l[0].lower()
+        v = len(l) != 1 and l[1].lstrip() or ''
         if k in d:
             if not type(d[k]) is list:
                 d[k] = [d[k]]