fix http response load when filter (#251)

This commit is contained in:
Hao Xiang
2025-09-17 04:01:00 +08:00
committed by GitHub
parent 8c3ed60579
commit fec64b5c02
11 changed files with 97 additions and 102 deletions

View File

@@ -13,7 +13,7 @@ interface Props {
}
export function HTMLOrTextViewer({ response, pretty, textViewerClassName }: Props) {
const rawTextBody = useResponseBodyText(response);
const rawTextBody = useResponseBodyText({ responseId: response.id, filter: null });
const contentType = getContentTypeFromHeaders(response.headers);
const language = languageFromContentType(contentType, rawTextBody.data ?? '');
@@ -24,7 +24,7 @@ export function HTMLOrTextViewer({ response, pretty, textViewerClassName }: Prop
if (language === 'html' && pretty) {
return <WebPageViewer response={response} />;
} else if (rawTextBody.data == null) {
return <EmptyStateText>Empty response</EmptyStateText>
return <EmptyStateText>Empty response</EmptyStateText>;
} else {
return (
<TextViewer