Commits

paulc  committed c7e33d0

Case insensitive match in matchGlob

  • Participants
  • Parent commits 3ff15ff
  • Branches py3

Comments (0)

Files changed (1)

File dnslib/label.py

     False
     >>> l3.stripSuffix("bbb.ccc.")
     <DNSLabel: 'xxx.yyy.aaa.'>
-    >>> l3.matchGlob("*.[abc]aa.bbb.ccc")
+    >>> l3.matchGlob("*.[abc]aa.BBB.ccc")
     True
     >>> l3.matchGlob("*.[abc]xx.bbb.ccc")
     False
     def matchGlob(self,pattern):
         if type(pattern) != DNSLabel:
             pattern = DNSLabel(pattern)
-        return fnmatch.fnmatch(str(self),str(pattern))
+        return fnmatch.fnmatch(str(self).lower(),str(pattern).lower())
 
     def matchSuffix(self,suffix):
         """