Requested: https://www.w3.org/2000/svg Found: http://www.w3.org/2000/svg [duplicate]

ε祈祈猫儿з 提交于 2019-12-23 09:41:54

问题


We are using Apache Batik to render SVG files. For security reasons, all the URLs are converted to HTTP.

Now, when we are rendering the SVG files, we get this issue.

  • Original SVG is:

    svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" 
    
  • Converted SVG is:

    svg xmlns=\"https://www.w3.org/2000/svg\" xmlns:xlink=\"https://www.w3.org/1999/xlink\"
    

So, I tried with Dhttps.protocols parameter from Java, no good. I'm digging source code for this.


回答1:


Don't change the URLs for namespace definitions. These are the attributes starting with xmlns, optionally followed by a : and a more detailed name.

For SVG, the namespace must be http://www.w3.org/2000/svg, see the specification.

These URLs are not used for connecting to, they just define what the elements mean (see XML Namespaces), so you're not gaining any security by changing them. Instead you're just making your SVG file invalid.



来源:https://stackoverflow.com/questions/39573020/requested-https-www-w3-org-2000-svg-found-http-www-w3-org-2000-svg

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!