Skip to content

Commit e067422

Browse files
committed
Show the HTTP version as a pill on request info
1 parent be4c200 commit e067422

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import * as React from 'react';
2+
3+
import { HtkRequest } from '../../types';
4+
import { styled } from '../../styles';
5+
6+
import { Pill } from './pill';
7+
8+
export const HttpVersionPill = styled(({ request, className }: {
9+
request: HtkRequest
10+
className?: string
11+
}) => request.httpVersion
12+
? <Pill
13+
title={`The client sent this request using HTTP ${request.httpVersion}`}
14+
>HTTP/{
15+
request.httpVersion === '2.0'
16+
? '2'
17+
: request.httpVersion
18+
}</Pill>
19+
: null
20+
)``;

src/components/view/http/http-request-card.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
} from '../../common/text-content';
3333
import { DocsLink } from '../../common/docs-link';
3434
import { SourceIcon } from '../../common/source-icon';
35+
import { HttpVersionPill } from '../../common/http-version-pill';
3536
import { HeaderDetails } from './header-details';
3637
import { UrlBreakdown } from '../url-breakdown';
3738

@@ -164,6 +165,7 @@ export const HttpRequestCard = observer((props: HttpRequestCardProps) => {
164165
/>
165166
}
166167
<SourceIcon source={request.source} />
168+
<HttpVersionPill request={request} />
167169
<Pill color={getSummaryColour(exchange)}>
168170
{ exchange.isWebSocket() ? 'WebSocket ' : '' }
169171
{ request.method } {

0 commit comments

Comments
 (0)