Page MenuHomePhabricator

Wikimedia REST API returns HTTP Status Code 413 as "Unknown Error" instead of "Too Large"
Open, Needs TriagePublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):
Error is reproduced by this call: https://ja.wikipedia.org/api/rest_v1/page/mobile-sections/JIS_X_0213%E6%BC%A2%E5%AD%97%E4%B8%80%E8%A6%A7%E3%81%AE1%E9%9D%A2
It is a call to [[w:ja:JIS X 0213漢字一覧の1面]], which is currently ~597k bytes in size.

What happens?:
The following is returned.

{"type":"https://mediawiki.org/wiki/HyperSwitch/errors/unknown_error","method":"get","detail":"413: https://mediawiki.org/wiki/HyperSwitch/errors/unknown_error","uri":"/ja.wikipedia.org/v1/page/html/JIS_X_0213%E6%BC%A2%E5%AD%97%E4%B8%80%E8%A6%A7%E3%81%AE1%E9%9D%A2"}

What should have happened instead?:
The error message does not point to the correct page - the type and detail fields should point to https://www.mediawiki.org/wiki/HyperSwitch/errors/too_large instead.