【发布时间】:2021-04-20 07:16:54
【问题描述】:
在我的 React TypeScript 项目中,我使用了一些 .svg 图标,它们工作得非常好,但是在 WebStorm IDE 中的 Inspect Code 上它显示很弱警告,我必须解决所有警告(不抑制)。
与未加密协议检查的链接
使用未加密的协议(例如 HTTP)打开链接可能会将您的数据暴露给中间人攻击,这通常是危险的,并且可能对工件存储库特别有害。使用带有加密的协议,例如 HTTPS。欲了解更多信息,See Wikipedia
我已经尝试搜索此问题的修复程序,但无法找到相关的内容,如果有人能建议解决此问题的最佳方法,我将不胜感激。
阅读: Does svg xmlns attribute value requires protocol? Can it be https or relative?
SVG:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" viewBox="0 0 24 24"><defs><style>.a{fill:#0d0d0d;}.b{clip-path:url(#a);}.c{fill:#fff;}.d{filter:url(#b);}</style><clipPath id="a"><rect class="a" width="24" height="24" transform="translate(0.187 0.375)"/></clipPath><filter id="b" x="-14.937" y="-11.875" width="52.893" height="47.468" filterUnits="userSpaceOnUse"><feOffset input="SourceAlpha"/><feGaussianBlur stdDeviation="6" result="c"/><feFlood flood-color="#0670eb"/><feComposite operator="in" in2="c"/><feComposite in="SourceGraphic"/></filter></defs><g class="b" transform="translate(-0.187 -0.375)"><g transform="translate(3.25 6.5)"><g class="d" transform="matrix(1, 0, 0, 1, -3.06, -6.13)"><path class="c" d="M11.039,17.951a1.2,1.2,0,0,1-.922-.4L5.2,12.506a1.3,1.3,0,0,1,1.888-1.8l4,4.128L19.515,6.84a1.3,1.3,0,0,1,1.8,1.888L11.961,17.6A1.51,1.51,0,0,1,11.039,17.951Z" transform="translate(-1.76 -0.36)"/></g></g></g></svg>
【问题讨论】:
-
然后将其报告为 webstorm 中的错误。这不是协议,而是名称空间。命名空间类似于协议是巧合。悬停苍蝇类似于黄蜂,但这并不能使它成为黄蜂。
-
@RobertLongson 感谢您的回复,将尝试在 WebStorm 上报告:)
标签: html typescript security svg webstorm