Skip to content

Commit 8becc9a

Browse files
authored
Update response-body.jsx
Add support for svg images, with this change we will show an actual preview of the image
1 parent 351dbf9 commit 8becc9a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/core/components/response-body.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ export default class ResponseBody extends React.Component {
4343

4444
// Image
4545
} else if (/^image\//i.test(contentType)) {
46-
bodyEl = <img style={{ maxWidth: "100%" }} src={ window.URL.createObjectURL(content) } />
46+
if(contentType.includes("svg")) {
47+
bodyEl = <div> { content } </div>
48+
} else {
49+
bodyEl = <img style={{ maxWidth: "100%" }} src={ window.URL.createObjectURL(content) } />
50+
}
4751

4852
// Audio
4953
} else if (/^audio\//i.test(contentType)) {

0 commit comments

Comments
 (0)