Strip leading and trailing whitespace before parsing.

This commit is contained in:
Stuart D. Gathman
2011-06-14 15:47:04 -04:00
parent 52454945cc
commit 6fb16453d9
4 changed files with 9 additions and 7 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ def parse_tag_value(tag_list):
@param tag_list: A string containing a DKIM Tag=Value list.
"""
tags = {}
tag_specs = tag_list.split(b';')
tag_specs = tag_list.strip().split(b';')
# Trailing semicolons are valid.
if not tag_specs[-1]:
tag_specs.pop()