MCPcopy
hub / github.com/mitmproxy/mitmproxy / prettify

Method prettify

mitmproxy/contentviews/_view_xml_html.py:252–262  ·  view source on GitHub ↗
(
        self,
        data: bytes,
        metadata: Metadata,
    )

Source from the content-addressed store, hash-verified

250 syntax_highlight = "xml"
251
252 def prettify(
253 self,
254 data: bytes,
255 metadata: Metadata,
256 ) -> str:
257 if metadata.http_message:
258 data_str = metadata.http_message.get_text(strict=False) or ""
259 else:
260 data_str = data.decode("utf8", "backslashreplace")
261 tokens = tokenize(data_str)
262 return format_xml(tokens)
263
264 def render_priority(
265 self,

Callers

nothing calls this directly

Calls 4

format_xmlFunction · 0.85
tokenizeFunction · 0.70
get_textMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected