Page MenuHomePhabricator

Mobile web wrongly uses desktop domain for load.php
Closed, ResolvedPublic

Description

https://en.m.wikipedia.org/wiki/Catwalk HTML source:

<link rel="apple-touch-icon" href="/static/apple-touch/wikipedia.png" />
<link rel="shortcut icon" href="/static/favicon/wikipedia.ico" />
<link rel="search" type="application/opensearchdescription+xml" href="/w/opensearch_desc.php" title="Wikipedia (en)" />
<link rel="EditURI" type="application/rsd+xml" href="//en.wikipedia.org/w/api.php?action=rsd" />
<link rel="copyright" href="//creativecommons.org/licenses/by-sa/3.0/" />
<link rel="alternate" type="application/atom+xml" title="Wikipedia Atom feed" href="/w/index.php?title=Special:RecentChanges&amp;feed=atom" />
<link rel="canonical" href="https://en.wikipedia.org/wiki/Runway_(fashion)" />
<link rel="stylesheet" href="//en.wikipedia.org/w/load.php?debug=false&amp;lang=en&amp;modules=ext.gather.menu.icon%7Cmediawiki.ui.button%2Cicon%7Cskins.minerva.base.reset%2Cstyles%7Cskins.minerva.content.styles%7Cskins.minerva.tablet.styles&amp;only=styles&amp;skin=minerva&amp;target=mobile&amp;*" />
<meta name="ResourceLoaderDynamicStyles" content="" />
<link rel="stylesheet" href="//en.wikipedia.org/w/load.php?debug=false&amp;lang=en&amp;modules=user.groups&amp;only=styles&amp;skin=minerva&amp;target=mobile&amp;user=Krinkle&amp;version=By7mXc%2Fa&amp;*" />
<script src="//en.wikipedia.org/w/load.php?debug=false&amp;lang=en&amp;modules=startup&amp;only=scripts&amp;skin=minerva&amp;target=mobile&amp;*"></script>
<script>if(window.mw){

Most references are relative (/static, /wiki). And most that use the desktop domain are meant to be canonical.

But the load.php references should probably be relative instead of absolute so that they make optimal use of SPDY.

Event Timeline

Krinkle raised the priority of this task from to Needs Triage.
Krinkle updated the task description. (Show Details)
Krinkle added subscribers: Krinkle, ori, Catrope.

So the issue is $wgLoadScript = "{$wgServer}/w/load.php";

Here are some possible solutions:

  1. We drop wgServer from $wgLoadScript to make it relative.
  2. We redefine $wgServer in the mobile config (https://github.com/wikimedia/operations-mediawiki-config/blob/master/wmf-config/InitialiseSettings.php#L1299)
  3. MobileFrontend should apply wgMobileUrlTemplate to the global in some way.

I'm leaning towards 1 or 2. I'm not 100% sure of the impact of 1. We could always do it for mobile first and then see if there is an fall out before applying globally.

Thoughts?

BBlack triaged this task as High priority.Jul 30 2015, 6:20 PM
BBlack subscribed.

Switching this to high. I noticed this while looking at bits hostname work, and realized that this is probably a problem for zero-rating by IP whitelists (zero-rated mobile traffic would be hitting load.php over the Desktop IPs, which are not whitelisted and thus might charge for traffic).

Change 228042 had a related patch set uploaded (by Ori.livneh):
Use relative URLs to construct load.php requests

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

Change 228042 merged by jenkins-bot:
Use relative URLs to construct load.php requests

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

Change 228044 had a related patch set uploaded (by Ori.livneh):
Use absolute URLs to construct load.php requests

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

Change 228044 merged by jenkins-bot:
Use absolute URLs to construct load.php requests

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

Jdlrobson subscribed.

I guess 1 was the preferred solution.

Change 228122 had a related patch set uploaded (by Ori.livneh):
Update URL configuration for mobile when entering mobile mode

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

Change 228122 merged by jenkins-bot:
Update URL configuration for mobile when entering mobile mode

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

This is now fixed. The fix does not affect URL references in cached HTML, though.

The mobile cache refs should all be wiped now, too.

Change 238537 had a related patch set uploaded (by Krinkle):
resourceloader: Don't call wfExpandUrl() on load.php urls

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

Change 238543 had a related patch set uploaded (by Krinkle):
Remove hardcoded $wgCanonicalServer from $wgResourceBasePath

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

Change 238544 had a related patch set uploaded (by Krinkle):
resourceloader: Don't call wfExpandUrl() on load.php urls

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

Change 238545 had a related patch set uploaded (by Krinkle):
resourceloader: Don't call wfExpandUrl() on load.php urls

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

Change 238543 merged by jenkins-bot:
Remove hardcoded $wgCanonicalServer from $wgResourceBasePath

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

Change 238537 merged by jenkins-bot:
resourceloader: Don't call wfExpandUrl() on load.php urls

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

Change 238545 merged by jenkins-bot:
resourceloader: Don't call wfExpandUrl() on load.php urls

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

Change 238544 merged by jenkins-bot:
resourceloader: Don't call wfExpandUrl() on load.php urls

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