Closed lniwn closed 6 years ago
感谢你的反馈,刚刚也有人反馈过这个问题,我们会立即修正!
这个问题的原因是btoa
不支持中文造成的。@lniwn 在bug修复前,你可以将设置修改为:
pageURL: location.href
// location.href 会自动将地址中的中文进行编码转换。
来修正这个错误,后面我们在修正时也会兼容这种用法。 预期修正方法见下面一条。
@cheng-kang 可以强制将url
进行urlencode
, 从而避免中文问题
btoa(encodeURIComponent(url))
找到了 MDN 对于这个问题的描述以及推荐解决方案。我会采用方案一,然后尽快提交一个新版本。
The issue and solution recommendation.
The "Unicode Problem" - Base64 encoding and decoding - MDN Web Docs
请参考 #16 。
Please refer to #16 .
Duplicate of #16
Fixed in 0d89379
问题描述 Issue Description
怎么了 What
pageURL字段值包含中文或者其他非标准url字段,会导致wildfire一直处于加载中
如何重现 Reproduce
pageURL: '{{page.permalink}}'
其他的话 Other Comment
现在的临时解决方案是,在swig层对url进行编码
pageURL: '{{page.permalink|url_encode}}'
,具体可以参考我的博客。 但还是觉得sdk层应该对这种不可信url进行编码之后再处理比较好。