Page MenuHomePhabricator

Proton should handle `/pdf/:title` requests
Closed, ResolvedPublic

Description

Proton /pdf route requires both :title: and :format parameters. Restbase on the other hand requires only :title format . When :format is not specified, it will use a4 as default - see https://github.com/wikimedia/restbase/blob/a1edf249e1e1c89e014bba1a7b98199e97db0d02/v1/pdf.yaml#L84

When Proton is exposed via restbase, it can handle /pdf/Book request (as Restbase will append the format parameter). Once we expose Proton via RestGateway, the RestGateway will pass through requests, therefore /pdf/Book will be passed unchanged to Proton, which will end up with HTTP Error 404, not found as format parameter is missing.

There are two possible solutions:
a) follow the current practice and implement optional parameter handling in RestGateway
b) let Proton handle the default format parameter

I propose to follow the b) and keep RestGateway logic free/work only as a proxy. The whole responsibility of route handling/optional parameters/etc should be fully handled by Proton service itself.

Event Timeline

Change 933885 had a related patch set uploaded (by D3r1ck01; author: Derick Alangi):

[mediawiki/services/chromium-render@master] RESTBase defaults to A4 format, Proton should behave similarly

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

Change 934289 had a related patch set uploaded (by Pmiazga; author: Pmiazga):

[mediawiki/services/chromium-render@master] Make PDF format optional and use a4 as default

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

Change 933885 abandoned by D3r1ck01:

[mediawiki/services/chromium-render@master] RESTBase defaults to A4 format, Proton should behave similarly

Reason:

Superseded by Ica151e3cfc0dd3fbdcb69c5dfe06abb22e74e037

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

Change 934289 merged by jenkins-bot:

[mediawiki/services/chromium-render@master] Make PDF format optional and use a4 as default

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

Change 934316 had a related patch set uploaded (by D3r1ck01; author: Derick Alangi):

[operations/deployment-charts@master] proton: Deploy latest Proton image - 2023-06-29-120130-production

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

Change 934316 merged by jenkins-bot:

[operations/deployment-charts@master] proton: Deploy latest Proton image - 2023-06-29-120130-production

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