[英]Resource interpreted as Document but transferred with MIME type image/svg+xml:
When I have an SVG picture with JavaScript chrome says 'Resource interpreted as Document but transferred with MIME type image/svg+xml'. 当我有一个带有JavaScript chrome的SVG图片时,说“资源被解释为文档,但以MIME类型image / svg + xml传输”。 I can include it with iframe or embed TAG same result.
我可以将其包含在iframe中,也可以嵌入TAG相同的结果。 But when I change the mime type to something different the browser cannot render it.
但是,当我将mime类型更改为其他类型时,浏览器无法呈现它。 So i guess "image/svg+xml" is correct?
所以我猜“ image / svg + xml”是正确的吗?
SVG SVG
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg version="1.1" baseProfile="full" id="draw"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 480 480">
<defs>
<style type="text/css">
<![CDATA[
]]>
</style>
</defs>
<rect x="0" y="0" width="480" height="480" rx="0" ry="0" fill="rgb(255, 255, 255)" />
</g>
<script type="text/ecmascript"><![CDATA[
(function () {
//Some code here
}());
]]>
</script>
</svg>
是的, image/svg+xml
是SVG内容的正确互联网媒体类型,请参阅IANA 。
I had this problem for a long time but it appears application/svg-xml is the correct mime. 我这个问题已经很长时间了,但是看来application / svg-xml是正确的mime。
Refer to this https://github.com/w3c/svgwg/issues/266 for more details. 有关更多详细信息,请参阅此https://github.com/w3c/svgwg/issues/266 。 The mime/svg-xml may be vulnerable too.
mime / svg-xml也可能容易受到攻击。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.