Page MenuHomePhabricator

mobile-html: Accept-Language cannot be applied properly
Closed, ResolvedPublic

Description

Steps to reproduce

  1. Request https://zh.wikipedia.org/api/rest_v1/page/mobile-html/贝拉克·奥巴马 with Accept-Language: zh-hant, and you'll see the article content in Traditional Chinese.
  2. Do the request again but with Accept-Language: zh-hans, and it still shows the article content in Traditional Chinese. (but it should be in Simplified Chinese).

Looks like the endpoint only applies the Accept-Language for the first time.

Details

Related Gerrit Patches:

Event Timeline

cooltey created this task.Mon, Dec 2, 8:44 PM
Restricted Application added subscribers: Cosine02, Aklapper. · View Herald TranscriptMon, Dec 2, 8:44 PM

Change 554150 had a related patch set uploaded (by Mholloway; owner: Michael Holloway):
[mediawiki/services/mobileapps@master] Fix: Apply language headers to mobileview (zhwiki) mobile-html response

https://gerrit.wikimedia.org/r/554150

Change 554150 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] Fix: Apply language headers to mobileview (zhwiki) mobile-html response

https://gerrit.wikimedia.org/r/554150

Mentioned in SAL (#wikimedia-operations) [2019-12-03T03:47:38Z] <mholloway-shell@deploy1001> Started deploy [mobileapps/deploy@d00c6ad]: Fix: Apply language headers to zhwiki mobile-html responses (T239659)

Mentioned in SAL (#wikimedia-operations) [2019-12-03T03:53:30Z] <mholloway-shell@deploy1001> Finished deploy [mobileapps/deploy@d00c6ad]: Fix: Apply language headers to zhwiki mobile-html responses (T239659) (duration: 05m 51s)

Mholloway claimed this task.Tue, Dec 3, 6:25 PM

@cooltey Please resolve the task if you can confirm that it's now working correctly.

cooltey closed this task as Resolved.Tue, Dec 3, 6:34 PM

Looks good to me now. Thanks @Mholloway

cooltey reopened this task as Open.Fri, Dec 6, 1:13 AM

Hi @Mholloway

Just found this article still has the issue:
https://zh.wikipedia.org/api/rest_v1/page/mobile-html/物联网

Not sure if the redirected title affects the Accept-Language setup?

I tested just now, and the Accept-Language header is honored when I request that page. I see that the page was edited this morning, so it's possible that an old version without the header adjustments was coming from RESTBase or ATS/Varnish but has now been replaced.

Shizhao moved this task from Closed to Backlog on the Chinese-Sites board.Mon, Dec 9, 6:34 AM

I see, thanks for checking @Mholloway.

cooltey closed this task as Resolved.Mon, Dec 9, 6:08 PM
Shizhao moved this task from Backlog to Closed on the Chinese-Sites board.Tue, Dec 10, 2:31 AM