Permalink
Browse files

Allow semicolons on end of media type

Also remove bad import from tcp/direction.py
  • Loading branch information...
1 parent 91070a7 commit 6fc5c31bd9dbe2d6626afb7e7efbe4d9742ec058 Andrew Fleenor committed Jul 12, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 mediatype.py
  2. +1 −1 tcp/direction.py
View
@@ -15,7 +15,7 @@ class MediaType(object):
# of string as the types above, values are pretty much anything but another
# semicolon
mediatype_re = re.compile(
- r'^([\w\-+.]+)/([\w\-+.]+)((?:\s*;\s*[\w\-]+=[^;]+)*)\s*$'
+ r'^([\w\-+.]+)/([\w\-+.]+)((?:\s*;\s*[\w\-]+=[^;]+)*);?\s*$'
)
# RE for parsing name-value pairs
nvpair_re = re.compile(r'^\s*([\w\-]+)=([^;\s]+)\s*$')
View
@@ -2,7 +2,7 @@
import chunk as tcp
from operator import itemgetter, attrgetter
import logging as log
-from pcap2har import settings
+import settings
import packet
import logging

0 comments on commit 6fc5c31

Please sign in to comment.