Fix and test case for case insensitive subdomain matching.
This commit is contained in:
+1
-1
@@ -161,7 +161,7 @@ def validate_signature_fields(sig):
|
|||||||
# Nasty hack to support both str and bytes... check for both the
|
# Nasty hack to support both str and bytes... check for both the
|
||||||
# character and integer values.
|
# character and integer values.
|
||||||
if b'i' in sig and (
|
if b'i' in sig and (
|
||||||
not sig[b'i'].endswith(sig[b'd']) or
|
not sig[b'i'].lower().endswith(sig[b'd'].lower()) or
|
||||||
sig[b'i'][-len(sig[b'd'])-1] not in ('@', '.', 64, 46)):
|
sig[b'i'][-len(sig[b'd'])-1] not in ('@', '.', 64, 46)):
|
||||||
raise ValidationError(
|
raise ValidationError(
|
||||||
"i= domain is not a subdomain of d= (i=%s d=%s)" %
|
"i= domain is not a subdomain of d= (i=%s d=%s)" %
|
||||||
|
|||||||
@@ -232,6 +232,7 @@ b/mPfjC0QJTocVBq6Za/PlzfV+Py92VaCak19F4WrbVTK5Gg5tW220MCAwEAAQ==
|
|||||||
b'bh': b'n0HUwGCP28PkesXBPH82Kboy8LhNFWU9zUISIpAez7M=',
|
b'bh': b'n0HUwGCP28PkesXBPH82Kboy8LhNFWU9zUISIpAez7M=',
|
||||||
b'c': b'simple/simple',
|
b'c': b'simple/simple',
|
||||||
b'd': b'kitterman.com',
|
b'd': b'kitterman.com',
|
||||||
|
b'i': b'scott@Kitterman.com',
|
||||||
b'h': b'From:To:Subject:Date:Cc:MIME-Version:Content-Type:\n \t Content-Transfer-Encoding:Message-Id',
|
b'h': b'From:To:Subject:Date:Cc:MIME-Version:Content-Type:\n \t Content-Transfer-Encoding:Message-Id',
|
||||||
b's': b'2007-00',
|
b's': b'2007-00',
|
||||||
b't': b'1299525798'}
|
b't': b'1299525798'}
|
||||||
|
|||||||
Reference in New Issue
Block a user