【译文】升级到Parsoid 0.9.0 带来的406 Not Acceptable docserver error

Some of my mediawiki instances broke when editing a page with VisualEditor on REL_30 today bringing HTTP 416 Errors related to Parsoid.
今天在使用VisualEditor REL_30编辑页面时,出现了mediawiki实例崩溃问题,导致与Parsoid相关的链接HTTP
416错误。

Strangely this error only occured when editing existing pages, simplyfied as curl below:
奇怪的是,这个错误只发生在编辑已有页面时才发生,简单描述如下:

curl "http://NAME_OF_WIKI_HERE/api.php?action=visualeditor&format=json&paction=parse&page=Main_Page&uselang=en"
{"error":{"code":"apierror-visualeditor-docserver-http","info":"HTTP 406","*":"See http://NAME_OF_WIKI_HERE/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."}}%

After a while I found that parsoid announced the behavoiur on there github rep:
过了一会儿我发现Parsoid在Github的代表发表了公告

This release requires clients (VE, etc.) to return a 1.6.0 and greater HTML version string in the header. If not, Parsoid will return a HTTP 406. This can be fixed by updating VE (or relevant clients) to a more recent version.
该版本更新要求客户端(VE等)返回1.6.0以上的HTML版本串在头部.如果没有的话,Parsoid将会返回一个HTTP 406.在您更新VE(或相关客户端)到更新的版本时将会修复.

Unfortunately I used their .deb repository releases.wikipedia.org which didn’t provide the 0.8.0 package for reverting the update. And since I’ve already updated -marking it on hold in apt was no longer an option.
不幸的是,我使用了他们releases.wikipedia.org的.deb存储库,而该库中没有提供用于恢复更新到0.8.0的软件包。而且自从我更新后,-marking在apt中不再是可选项.

After reading a bit through the source code the solution I found until the next mediawiki stable versions arrives can be followed by editing the:
在阅读源代码后,我发现了一个在下次Mediawiki更新前可以临时解决的方案.通过编辑:

lib/config/ParsoidConfig.js

and switch this line:
查找这一行:

ParsoidConfig.prototype.strictAcceptCheck = true;

to that
改为

ParsoidConfig.prototype.strictAcceptCheck = false; //true;

It’s not pretty, but for now it solved my issues.
这不是好的做法,但他现在解决了我的问题.

原文:Parsoid 0.9.0 update brings 406 Not Acceptable docserver error in VisualEditor REL_30 on Mediawiki 1.30(Proxy Required)


特别提示:

受制于文章早前发布的平台segmentfault.com,本文协议采用知识共享署名 – 非商业性使用 – 非衍生物4.0国际许可协议授权,不同于以往的CC-BY-4.0,请悉知。关于本站的著作权政策,请点击此处

知识共享许可

发布者:Hatsune miki

平凡的人做不平凡的事,走不平凡的路.

留下评论

电子邮件地址不会被公开。 必填项已用*标注

*

code