简体   繁体   English

资源被解释为文档,但以MIME类型image / svg + xml传输:

[英]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.

相关问题 资源被解释为文档,但以MIME类型application / json传输 - Resource interpreted as Document but transferred with MIME type application/json 资源被解释为 Document 但使用 MIME 类型 application/zip 传输 - Resource interpreted as Document but transferred with MIME type application/zip 资源解释为Document但使用MIME类型application / json,laravel进行传输 - Resource interpreted as Document but transferred with MIME type application/json,laravel window.location.href-资源解释为文档,但以MIME类型传输 - window.location.href - Resource interpreted as Document but transferred with MIME type 错误:资源被解释为文档,但以MIME类型application / pdf传输 - Error: Resource interpreted as Document but transferred with MIME type application/pdf Google地图 - 资源解释为脚本,但使用MIME类型image / png进行传输 - Google Maps - Resource interpreted as Script but transferred with MIME type image/png 资源解释为Image但使用MIME类型application / octet-stream传输 - Resource interpreted as Image but transferred with MIME type application/octet-stream opencart 2.2资源被解释为文档,但通过MIME传输 - opencart 2.2 Resource interpreted as Document but transferred with MIME iframe显示MIME警告pdfmake:将资源解释为文档,但以MIME类型application / pdf进行传输: - iframe shows MIME warning pdfmake: Resource interpreted as Document but transferred with MIME type application/pdf: 资源被解释为样式表,但与mime一起传输 - Resource interpreted as Stylesheet but transferred with mime
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM