Update response-body.jsx

Add support for svg images, with this change we will show an actual preview of the image
This commit is contained in:
Helder Sepulveda
2017-12-11 15:14:58 -05:00
committed by GitHub
parent 351dbf981b
commit 8becc9a9a7

View File

@@ -43,7 +43,11 @@ export default class ResponseBody extends React.Component {
// Image
} else if (/^image\//i.test(contentType)) {
bodyEl = <img style={{ maxWidth: "100%" }} src={ window.URL.createObjectURL(content) } />
if(contentType.includes("svg")) {
bodyEl = <div> { content } </div>
} else {
bodyEl = <img style={{ maxWidth: "100%" }} src={ window.URL.createObjectURL(content) } />
}
// Audio
} else if (/^audio\//i.test(contentType)) {