Fix #3571 to support image/webp in mitmweb to display previews

This commit is contained in:
Cixtor 2019-12-17 12:52:14 -08:00
parent 67955fad32
commit c872a5c700
No known key found for this signature in database
GPG Key ID: 47F1EDC2110482B6

View File

@ -7,7 +7,7 @@ import { MessageUtils } from '../../flow/utils'
import CodeEditor from './CodeEditor'
const isImage = /^image\/(png|jpe?g|gif|vnc.microsoft.icon|x-icon)$/i
const isImage = /^image\/(png|jpe?g|gif|webp|vnc.microsoft.icon|x-icon)$/i
ViewImage.matches = msg => isImage.test(MessageUtils.getContentType(msg))
ViewImage.propTypes = {
flow: PropTypes.object.isRequired,