HomePhabricator

Tighten the MW request
c08ced501ad8Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.
This commit has been deleted in the repository: it is no longer reachable from any branch, tag, or ref.

Description

Tighten the MW request

We need to be able to restrict the hosts that Proton sends requests to
for security reasons. In order to achieve that, rework the current code
to be able to use a template in production that satisfies these needs.

Concretely, we always use the canonical /w/index.php end point and set
the title in the query parameters. Additionally, we set the Host
header so that the production MW appservers know which domain the
request is for. Finally, we need to distinguish between desktop and
mobile view requests. The way that MW (and MF) do that is by looking at
the X-Subdomain header, so we set that one. Because of these changes,
we are now passing in the request headers as part of the data object
and tell puppeteer to set them when fetching the HTML.

Bug: T198461
Change-Id: Ia73c47ac35c4fdd6ffb6b326f69a911a2e6ca70d

Details

Provenance
mobrovacAuthored on Jul 2 2018, 4:47 PM
Parents
rMSCR3057a7e5094b: Hygiene: clean up html2pdf endpoint
Branches
Unknown
Tags
Unknown
ChangeId
Ia73c47ac35c4fdd6ffb6b326f69a911a2e6ca70d