web: display WS/WSS as method

This commit is contained in:
Maximilian Hils 2022-03-19 14:37:33 +01:00
parent 628d6201ae
commit a0e04a7833
3 changed files with 13 additions and 3 deletions

View File

@ -177,7 +177,7 @@ exports[`should render columns: method 1`] = `
<td
class="col-method"
>
GET
WSS
</td>
</tr>
</tbody>

View File

@ -34,7 +34,7 @@ exports[`FlowRow 1`] = `
<td
class="col-method"
>
GET
WSS
</td>
<td
class="col-status"

View File

@ -107,8 +107,18 @@ path.headerName = 'Path'
path.sortKey = flow => 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 (
<td className="col-method">{flow.type === "http" ? flow.request.method : flow.type.toUpperCase()}</td>
<td className="col-method">{method}</td>
)
};
method.headerName = 'Method'