From a0e04a783304cbc497942fcfb2fb774b39051faf Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sat, 19 Mar 2022 14:37:33 +0100 Subject: [PATCH] web: display WS/WSS as method --- .../FlowTable/__snapshots__/FlowColumnsSpec.tsx.snap | 2 +- .../FlowTable/__snapshots__/FlowRowSpec.tsx.snap | 2 +- web/src/js/components/FlowTable/FlowColumns.tsx | 12 +++++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/web/src/js/__tests__/components/FlowTable/__snapshots__/FlowColumnsSpec.tsx.snap b/web/src/js/__tests__/components/FlowTable/__snapshots__/FlowColumnsSpec.tsx.snap index 923d67e12..9f5443619 100644 --- a/web/src/js/__tests__/components/FlowTable/__snapshots__/FlowColumnsSpec.tsx.snap +++ b/web/src/js/__tests__/components/FlowTable/__snapshots__/FlowColumnsSpec.tsx.snap @@ -177,7 +177,7 @@ exports[`should render columns: method 1`] = ` - GET + WSS diff --git a/web/src/js/__tests__/components/FlowTable/__snapshots__/FlowRowSpec.tsx.snap b/web/src/js/__tests__/components/FlowTable/__snapshots__/FlowRowSpec.tsx.snap index e42d25fa1..323d075f5 100644 --- a/web/src/js/__tests__/components/FlowTable/__snapshots__/FlowRowSpec.tsx.snap +++ b/web/src/js/__tests__/components/FlowTable/__snapshots__/FlowRowSpec.tsx.snap @@ -34,7 +34,7 @@ exports[`FlowRow 1`] = ` - GET + WSS mainPath(flow) export const method: FlowColumn = ({flow}) => { + let method; + if(flow.type === "http") { + if(flow.websocket) { + method = flow.client_conn.tls_established ? "WSS" : "WS"; + } else { + method = flow.request.method; + } + } else { + method = flow.type.toUpperCase(); + } return ( - {flow.type === "http" ? flow.request.method : flow.type.toUpperCase()} + {method} ) }; method.headerName = 'Method'