MCPcopy
hub / github.com/mitmproxy/mitmproxy / getContentURL

Method getContentURL

web/src/js/flow/utils.ts:53–71  ·  view source on GitHub ↗
(
        flow: Flow,
        part: HTTPMessage | "request" | "response" | "messages",
        view?: string,
        lines?: number,
    )

Source from the content-addressed store, hash-verified

51 }
52
53 static getContentURL(
54 flow: Flow,
55 part: HTTPMessage | "request" | "response" | "messages",
56 view?: string,
57 lines?: number,
58 ): string {
59 if (flow.type === "http" && part === flow.request) {
60 part = "request";
61 } else if (flow.type === "http" && part === flow.response) {
62 part = "response";
63 }
64 const lineStr = lines ? `?lines=${lines}` : "";
65 return (
66 `./flows/${flow.id}/${part}/` +
67 (view
68 ? `content/${encodeURIComponent(view)}.json${lineStr}`
69 : "content.data")
70 );
71 }
72}
73
74export class RequestUtils extends MessageUtils {

Callers 6

useContentViewFunction · 0.45
HttpMessageEditFunction · 0.45
handleClickCopyButtonFunction · 0.45
ViewImageFunction · 0.45
DownloadButtonFunction · 0.45
utilsSpec.tsxFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected