Page MenuHomePhabricator

Parsoid/PHP HTML output for PageBundle should contain Content-Language and Vary headers
Closed, ResolvedPublic

Description

Spotted while testing RESTBase with Parsoid/PHP. When replying to pagebundle requests, the HTML sub-section of the response body differs between JS and PHP:

JS
'content-type': 'text/html; charset=utf-8; profile="https://www.mediawiki.org/wiki/Specs/HTML/2.1.0"',
'content-language': 'en',
vary: 'Accept'
PHP
'content-type': 'text/html; charset=utf-8; profile="https://www.mediawiki.org/wiki/Specs/HTML/2.1.0"'

It seems like this feature was left out during the port but RESTBase relies on these for language conversions and caching.

Additionally, while looking at the Parsoid code, I realised that Parsoid/PHP forces content-language: en for all output, but that shouldn't be the case (since not all content's language is en).

Details

Related Gerrit Patches:
mediawiki/services/parsoid : masterAdd language converter endpoints to the REST API

Event Timeline

mobrovac triaged this task as High priority.Oct 24 2019, 1:17 PM
mobrovac created this task.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 24 2019, 1:17 PM

I was mentioning this to @mobrovac on IRC, but looks like they need these headers independent of LC endpoints. Unless the LC endpoints are done, how difficult is it to pull out the code that sets these headers into a separate patch so we can merge that and unblock Marko?

Unless the LC endpoints are done, how difficult is it to pull out the code that sets these headers into a separate patch so we can merge that and unblock Marko?

It wouldn't be too difficult but the patch is nearly done.

mobrovac closed this task as Resolved.Oct 24 2019, 5:44 PM
mobrovac claimed this task.

@ssastry and I discussed this on IRC. Since language conversion will be merged before T229015: Tracking: Direct live production traffic at Parsoid/PHP, it is safe to work around this in RESTBase for now (BUT leave a todo and log it in case this ever happens), so I will do that.

Change 545391 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Add language converter endpoints to the REST API

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

Change 545391 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Add language converter endpoints to the REST API

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