https://bugzilla.wikimedia.org/show_bug.cgi?id=40679
--- Comment #10 from Roan Kattouw <[email protected]> 2012-10-02 03:20:37 UTC --- (In reply to comment #7) > There is no need to have two variables. Except if you want to have different URLs for HTTP and HTTPS, I think that was MZ was after. > The problems we have aren't solved by introducing that, and introducing that > pattern is already possible without those 2 variables: > > > $wgServer = isHttps() ? 'http://example.org' : 'https://example.org'; > > We don't need the other value anyway when in the other request type. > That doesn't actually work, it causes pollution of the parser cache, see my previous comment. > Except that we do, which is why we have a canonical protocol for API > responses. To expand on this: we have $wgCanonicalServer, which is a fully-qualified (i.e. with protocol) version of $wgServer that is used when building URLs that will be used outside of the context of an HTTP(S) request, or where using protocol-relative URLs won't work or doesn't make sense for some other reason. The typical examples of this is are URLs in notification e-mails and in the recentchanges IRC feeds. In the API, we resolve protocol-relative URLs using the protocol of the current request, and we split the API Squid cache by protocol for this reason; $wgCanonicalServer only comes into play when dealing with things like the externallinks table (see below). $wgCanonicalServer is used in two different ways: * when building URLs to wiki pages, or expanding URLs like /wiki/Foo , the URL is prefixed with $wgCanonicalServer instead of $wgServer * when we encounter a protocol-relative URL that came from somewhere else (e.g. externallinks table in the API), we use $wgCanonicalServer to decide which protocol to put on it As you might have guessed, $wgCanonicalServer is currently set to "http:$wgServer" on WMF wikis. I deliberately designed it so it could be switched to https later, that's why it's separate from $wgInternalServer (used for Squid purges, will still need to be http). As for actual plans to switch the canonical protocol to HTTPS, that's a question for Ryan. In the meantime, Chris's cookie-based redirection feature should reduce the annoyance of HTTP links in e-mail notifications, because people that receive these e-mails are usually logged in when they receive them, so they'll automatically be redirected to HTTPS. -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
