Skip to content

Commit 00127b7

Browse files
committed
Drop redundant HTTP/2 header section
This data is all visible in the UI elsewhere (URL, status, etc)
1 parent 142a35c commit 00127b7

File tree

1 file changed

+3
-44
lines changed

1 file changed

+3
-44
lines changed

src/components/view/http/header-details.tsx

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -192,37 +192,11 @@ export const HeaderDetails = inject('accountStore')(observer((props: {
192192
return <BlankContentPlaceholder>(None)</BlankContentPlaceholder>
193193
}
194194

195-
let [pseudoHeaders, normalHeaders] = _.partition(sortedHeaders, ([key]) =>
196-
props.httpVersion >= 2 && key.startsWith(':')
197-
);
198-
199-
if (normalHeaders.length === 0) {
200-
normalHeaders = pseudoHeaders;
201-
pseudoHeaders = [];
202-
}
195+
// Filter out HTTP/2 pseudo-headers - they're not relevant, as all details (URL,
196+
// method, status, etc) are shown elsewhere.
197+
const normalHeaders = sortedHeaders.filter(([key]) => !key.startsWith(':'));
203198

204199
return <HeadersGrid>
205-
{
206-
pseudoHeaders.length > 0 && <CollapsibleSection
207-
withinGrid={true}
208-
contentName='pseudo headers'
209-
>
210-
<CollapsibleSectionSummary>
211-
<PseudoHeadersHiddenMessage>
212-
HTTP/{
213-
props.httpVersion.toString().replace('.0', '')
214-
} pseudo-headers
215-
</PseudoHeadersHiddenMessage>
216-
</CollapsibleSectionSummary>
217-
218-
<PseudoHeadersContent>
219-
<PseudoHeaderDetails
220-
headers={pseudoHeaders}
221-
/>
222-
</PseudoHeadersContent>
223-
</CollapsibleSection>
224-
}
225-
226200
{ _.flatMap(normalHeaders, ([key, value], i) => {
227201
const docs = getHeaderDocs(key);
228202
const description = getHeaderDescription(
@@ -249,18 +223,3 @@ export const HeaderDetails = inject('accountStore')(observer((props: {
249223
}) }
250224
</HeadersGrid>;
251225
}));
252-
253-
const PseudoHeaderDetails = observer((props: {
254-
headers: RawHeaders
255-
}) => {
256-
return <HeadersGrid>
257-
{ _.flatMap(props.headers, ([key, value], i) => {
258-
return <CollapsibleSection
259-
contentName={`${key} header details`}
260-
withinGrid={true}
261-
key={`${key}-${i}`}>
262-
<HeaderKeyValue headerKey={key} headerValue={value} />
263-
</CollapsibleSection>;
264-
}) }
265-
</HeadersGrid>;
266-
});

0 commit comments

Comments
 (0)