From 21de10afee887d4bc5d5aefd9fe865f2301c7408 Mon Sep 17 00:00:00 2001 From: Ryan Cartwright <39504851+HomelessDinosaur@users.noreply.github.com> Date: Sat, 30 Mar 2024 10:39:04 +1100 Subject: [PATCH] fix: add check for content type to fix dashboard reference error (#706) --- .../src/components/apis/APIResponseContent.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/dashboard/frontend/src/components/apis/APIResponseContent.tsx b/pkg/dashboard/frontend/src/components/apis/APIResponseContent.tsx index ae9fca5e4..28488a16c 100644 --- a/pkg/dashboard/frontend/src/components/apis/APIResponseContent.tsx +++ b/pkg/dashboard/frontend/src/components/apis/APIResponseContent.tsx @@ -10,6 +10,19 @@ const APIResponseContent: React.FC = ({ response }) => { let contentType = response.headers!['content-type'] contentType = Array.isArray(contentType) ? contentType[0] : contentType + // Default to text response + if (!contentType) { + return ( + + ) + } + if (contentType.startsWith('image/')) { return (