Uncaught URIError: URI malformed with reCAPTCHA
Uncaught URIError: URI malformed with reCAPTCHA
在某些包含 url 编码部分的页面上,例如 %FC
而不是 ü
,我在控制台和验证码中收到 Uncaught URIError: URI malformed
错误因此不起作用。
我们的项目是 iso-8859-1
编码的,对此我无能为力。
您知道可以解决此问题的解决方法吗?我正在使用 reCAPTCHA 2。
我现在的解决方案是,在执行recaptcha/api.js
之前,我抓取window.location.pathname
,去掉有问题的元素,并在url中与[=13交换它=].如果我只是简单地更改 window.location.pathname
页面重定向将是结果。
这是我的示例代码:
var oldPath = window.location.pathname;
var newPath = decodeURIComponent( unescape( unescape(oldPath)));
var stateObj = {};
history.pushState(stateObj, "", newPath);
在某些包含 url 编码部分的页面上,例如 %FC
而不是 ü
,我在控制台和验证码中收到 Uncaught URIError: URI malformed
错误因此不起作用。
我们的项目是 iso-8859-1
编码的,对此我无能为力。
您知道可以解决此问题的解决方法吗?我正在使用 reCAPTCHA 2。
我现在的解决方案是,在执行recaptcha/api.js
之前,我抓取window.location.pathname
,去掉有问题的元素,并在url中与[=13交换它=].如果我只是简单地更改 window.location.pathname
页面重定向将是结果。
这是我的示例代码:
var oldPath = window.location.pathname;
var newPath = decodeURIComponent( unescape( unescape(oldPath)));
var stateObj = {};
history.pushState(stateObj, "", newPath);