(flow: Flow)
| 228 | }; |
| 229 | |
| 230 | export 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 | |
| 250 | export const statusCode = (flow: Flow): string | number | undefined => { |
| 251 | switch (flow.type) { |
no test coverage detected
searching dependent graphs…