fix(vuln): metric label extractor handles escaped quotes in f-strings
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
d4bea8a78c
commit
1763e27859
1 file changed
+1
-1
@@ -55,7 +55,7 @@ def label_names(text):
|
||||
tail = text[m.end(): m.end() + 200]
|
||||
close = tail.find("}\n")
|
||||
chunk = tail[: close if close != -1 else None].split("\n", 1)[0]
|
||||
for key in re.findall(r"([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*[\"'{]", chunk):
|
||||
for key in re.findall(r"([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*\\?[\"'{]", chunk):
|
||||
found.add(key)
|
||||
return found
|
||||
|
||||
|
||||
Reference in new issue
Block a user