@@ -15,7 +15,7 @@ class CPESpecial(Enum):
1515def parse_cpe22 (cpe : str ) -> tuple [CPEValue , CPEValue , CPEValue , CPEValue ]:
1616 """Parse a CPE 2.2 URI"""
1717
18- if not cpe .startswith ("cpe:/" ):
18+ if not cpe .lower (). startswith ("cpe:/" ):
1919 raise ValueError ("invalid cpe format" )
2020 components = []
2121 for part in cpe [5 :].split (":" ):
@@ -33,7 +33,7 @@ def parse_cpe22(cpe: str) -> tuple[CPEValue, CPEValue, CPEValue, CPEValue]:
3333def parse_cpe23 (cpe : str ) -> tuple [CPEValue , CPEValue , CPEValue , CPEValue ]:
3434 """Parse a CPE 2.3 string, also partial CPEs and missing components are treated as ANY."""
3535
36- if not cpe .startswith ("cpe:2.3:" ):
36+ if not cpe .lower (). startswith ("cpe:2.3:" ):
3737 raise ValueError ("invalid cpe format" )
3838
3939 def split_and_unquote (s : str ) -> list [CPEValue ]:
@@ -80,9 +80,9 @@ def push():
8080def parse_cpe (cpe : str ) -> tuple [CPEValue , CPEValue , CPEValue , CPEValue ]:
8181 """Parse a CPE string into a tuple for the first four components"""
8282
83- if cpe .startswith ("cpe:2.3:" ):
83+ if cpe .lower (). startswith ("cpe:2.3:" ):
8484 return parse_cpe23 (cpe )
85- elif cpe .startswith ("cpe:/" ):
85+ elif cpe .lower (). startswith ("cpe:/" ):
8686 return parse_cpe22 (cpe )
8787 else :
8888 raise ValueError ("unknown cpe format" )
0 commit comments