Replacing magic constant

This commit is contained in:
Seth Schoen
2015-05-14 12:07:39 -07:00
parent d443fd9074
commit 56b71e3b32
+3 -1
View File
@@ -241,4 +241,6 @@ def get_sans_from_cert(pem):
ext = x509.get_ext("subjectAltName")
except LookupError:
return []
return [x[4:] for x in ext.get_value().split(", ") if x.startswith("DNS:")]
prefix = "DNS:"
return [x[len(prefix):] for x in ext.get_value().split(", ")
if x.startswith(prefix)]