Skip to content

Commit

Permalink
fix: add check for content type to fix dashboard reference error (#706)
Browse files Browse the repository at this point in the history
  • Loading branch information
HomelessDinosaur authored Mar 29, 2024
1 parent 7b59bfc commit 21de10a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/dashboard/frontend/src/components/apis/APIResponseContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ const APIResponseContent: React.FC<Props> = ({ response }) => {
let contentType = response.headers!['content-type']
contentType = Array.isArray(contentType) ? contentType[0] : contentType

// Default to text response
if (!contentType) {
return (
<CodeEditor
id="api-response"
enableCopy
contentType={contentType}
value={response.data}
readOnly
/>
)
}

if (contentType.startsWith('image/')) {
return (
<img
Expand Down

0 comments on commit 21de10a

Please sign in to comment.