Merge pull request #4020 from heldersepu/patch-1

Update response-body.jsx to support SVG images
This commit is contained in:
kyle
2017-12-15 17:29:44 -08:00
committed by GitHub

View File

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