diff --git a/src/components/WebLogView/Row.tsx b/src/components/WebLogView/Row.tsx index eba46f48..d308aa7f 100644 --- a/src/components/WebLogView/Row.tsx +++ b/src/components/WebLogView/Row.tsx @@ -6,6 +6,7 @@ import { MethodBadge } from '../MethodBadge' import { ResponseStatusBadge } from '../ResponseStatusBadge' import { TableCellWithTooltip } from '../TableCellWithTooltip' import { HighlightedText } from '../HighlightedText' +import { getRequestType } from './WebLogView.utils' interface RowProps { data: ProxyDataWithMatches @@ -53,6 +54,7 @@ export function Row({ data, isSelected, onSelectRequest }: RowProps) { /> + {getRequestType(data)} diff --git a/src/components/WebLogView/WebLogView.tsx b/src/components/WebLogView/WebLogView.tsx index 7c66e475..3ba5b15b 100644 --- a/src/components/WebLogView/WebLogView.tsx +++ b/src/components/WebLogView/WebLogView.tsx @@ -93,6 +93,7 @@ function RequestList({ Method Status + Type Host Path diff --git a/src/components/WebLogView/WebLogView.utils.ts b/src/components/WebLogView/WebLogView.utils.ts index 50ac307a..1a0d4220 100644 --- a/src/components/WebLogView/WebLogView.utils.ts +++ b/src/components/WebLogView/WebLogView.utils.ts @@ -1,4 +1,6 @@ import { GroupedProxyData, ProxyData } from '@/types' +import { getContentType } from '@/utils/headers' +import { isNonStaticAssetResponse } from '@/utils/staticAssets' export function removeQueryStringFromUrl(url: string) { return url.split('?')[0] @@ -20,3 +22,12 @@ export function isGroupedProxyData( ): data is GroupedProxyData { return !Array.isArray(data) } + +export function getRequestType(data: ProxyData) { + if (isNonStaticAssetResponse(data)) { + return 'fetch' + } + + const mimeType = getContentType(data.response?.headers ?? []) + return mimeType ? mimeType.split('/')[1] : 'unknown' +}