(flow: Flow)
| 190 | export const canResumeOrKill = (flow: Flow): boolean => flow.intercepted; |
| 191 | |
| 192 | export const getIcon = (flow: Flow): string => { |
| 193 | if (flow.type !== "http") { |
| 194 | if (flow.client_conn.tls_version === "QUICv1") { |
| 195 | return `resource-icon-quic`; |
| 196 | } |
| 197 | return `resource-icon-${flow.type}`; |
| 198 | } |
| 199 | if (flow.websocket) { |
| 200 | return "resource-icon-websocket"; |
| 201 | } |
| 202 | if (!flow.response) { |
| 203 | return "resource-icon-plain"; |
| 204 | } |
| 205 | |
| 206 | const contentType = ResponseUtils.getContentType(flow.response) || ""; |
| 207 | |
| 208 | if (flow.response.status_code === 304) { |
| 209 | return "resource-icon-not-modified"; |
| 210 | } |
| 211 | if (300 <= flow.response.status_code && flow.response.status_code < 400) { |
| 212 | return "resource-icon-redirect"; |
| 213 | } |
| 214 | if (contentType.indexOf("image") >= 0) { |
| 215 | return "resource-icon-image"; |
| 216 | } |
| 217 | if (contentType.indexOf("javascript") >= 0) { |
| 218 | return "resource-icon-js"; |
| 219 | } |
| 220 | if (contentType.indexOf("css") >= 0) { |
| 221 | return "resource-icon-css"; |
| 222 | } |
| 223 | if (contentType.indexOf("html") >= 0) { |
| 224 | return "resource-icon-document"; |
| 225 | } |
| 226 | |
| 227 | return "resource-icon-plain"; |
| 228 | }; |
| 229 | |
| 230 | export const mainPath = (flow: Flow): string => { |
| 231 | switch (flow.type) { |
no test coverage detected
searching dependent graphs…