我正在运行一个脚本,它在后台使用 jquery-ajax 保存对 PHP 脚本的更改,并创建一个函数,如果脚本向网站发布内容,该函数会抛出错误。当它抛出错误时,我使用 console.log 进行 chrome 调试。
到目前为止,它运行良好。现在,大概 5 次中有 1 次,我在控制台中得到了这个。
<script src="/____proof-of-work/sha256.js"></script>
<script>
challengeString = "fc1bc435f0be5062b3420hc4970e8f77d8359904b50356959054180e014c24211a";
nonce = 0;
hash = sha256(challengeString + nonce);
while(1) {
hash = sha256(challengeString + nonce);
if (hash.substr(0, 4) === '0000')
break;
nonce += 1;
}
window.location.replace("/____proof-of-work/validate/" + nonce + "/" + window.location.href);
</script>
我真的不知道这是从哪里来的。我以前从未见过这段代码,我曾尝试用谷歌搜索它,但没有找到真正的解决方案。
它可能是什么,如何摆脱它?
最佳答案
我对 one.com 也有同样的问题。
这是 one.com 支持人员的回复:
Sehr geehrter Herr Heidingsfelder,
vielen Dank für Ihre Anfrage.
Bei proof-of-work handelt es sich um sogenannte JavaScript challenges, die von unserem Server abgesetzt werden, wenn viele Anfragen an dieselbe URL erfolgen. Hierdurch soll eine missbräuchliche Nutzung, etwa durch Malware- oder Spambots, bestmöglich eingeschränkt werden.
Eine Umgehung von proof-of-work ist im Sinne von Abs. 1.2 der Allgemeinen Geschäftsbedingungen unzulässig.
Bei weiteren Fragen stehen wir Ihnen gerne zur Verfügung.
Mit freundlichen Grüßen
Sascha one.com
英语:
Dear Mr. Heidingsfelder,
Thank you for your request.
Proof-of-Work is a JavaScript challenge that is dropped by our server when many requests are made to the same URL. This should be the best possible restriction of improper use, such as malware or spam bots.
A circumvention of proof of work is inadmissible within the meaning of paragraph 1.2 of the General Terms and Conditions.
For further questions please do not hesitate to contact us.
With best regards
Sascha one.com
我将终止与 one.com 的契约(Contract)。
问候
马克
关于javascript - 为什么在对 php 脚本使用 jquery ajax 时得到 sha256.js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58541017/