要求:https://www.w3.org/2000/svg找到:http://www.w3.org/2000/svg [英] Requested: https://www.w3.org/2000/svg Found: http://www.w3.org/2000/svg

查看:179
本文介绍了要求:https://www.w3.org/2000/svg找到:http://www.w3.org/2000/svg的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用Apache Batik渲染SVG文件.出于安全原因,所有URL都将转换为HTTP.

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

现在,当我们渲染SVG文件时,就会出现此问题.

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

  • 原始SVG为:

  • Original SVG is:

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

  • 转换后的SVG为:

  • Converted SVG is:

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

  • 因此,我尝试使用Java中的Dhttps.protocols参数,效果不好.我正在为此寻找源代码.

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

    推荐答案

    请勿更改名称空间定义的URL.这些是以xmlns开头的属性,可以选择在其后跟随:和更详细的名称.

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

    对于SVG,名称空间必须为http://www.w3.org/2000/svg,请参见规范.

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

    这些URL不用于连接,它们只是定义元素的含义(请参见 XML命名空间),因此您无法通过更改它们来获得任何安全性.相反,您只是使SVG文件无效.

    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://www.w3.org/2000/svg找到:http://www.w3.org/2000/svg的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    相关文章
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆