MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / in_script

Function in_script

examples/contrib/xss_scanner.py:344–352  ·  view source on GitHub ↗

Whether the Numberth occurrence of the first string in the second string is inside a script tag

(text, index, body)

Source from the content-addressed store, hash-verified

342 """Return a XSSDict if there is a XSS otherwise return None"""
343
344 def in_script(text, index, body) -> bool:
345 """Whether the Numberth occurrence of the first string in the second
346 string is inside a script tag"""
347 paths = paths_to_text(body.decode("utf-8"), text.decode("utf-8"))
348 try:
349 path = paths[index]
350 return "script" in path
351 except IndexError:
352 return False
353
354 def in_HTML(text: bytes, index: int, body: bytes) -> bool:
355 """Whether the Numberth occurrence of the first string in the second

Callers 1

get_XSS_dataFunction · 0.85

Calls 2

paths_to_textFunction · 0.85
decodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…