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

Function mainPath

web/src/js/flow/utils.ts:230–248  ·  view source on GitHub ↗
(flow: Flow)

Source from the content-addressed store, hash-verified

228};
229
230export const mainPath = (flow: Flow): string => {
231 switch (flow.type) {
232 case "http":
233 return RequestUtils.pretty_url(flow.request);
234 case "tcp":
235 case "udp":
236 return `${flow.client_conn.peername.join(
237 ":",
238 )} ↔ ${flow.server_conn?.address?.join(":")}`;
239 case "dns":
240 return `${flow.request.questions
241 .map((q) => `${q.name} ${q.type}`)
242 .join(", ")} = ${
243 (flow.response?.answers.map((q) => q.data).join(", ") ??
244 "...") ||
245 "?"
246 }`;
247 }
248};
249
250export const statusCode = (flow: Flow): string | number | undefined => {
251 switch (flow.type) {

Callers 1

pathFunction · 0.90

Calls 3

pretty_urlMethod · 0.45
joinMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…