Merge "resourceloader: Add content hash to static debug urls"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sun, 21 Feb 2016 02:40:28 +0000 (02:40 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 21 Feb 2016 02:40:28 +0000 (02:40 +0000)
includes/resourceloader/ResourceLoaderFileModule.php

index b31e8dc..6924d31 100644 (file)
@@ -341,10 +341,6 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                        $remoteBasePath = (string)$options['remoteBasePath'];
                }
 
-               // Make sure the remote base path is a complete valid URL,
-               // but possibly protocol-relative to avoid cache pollution
-               $remoteBasePath = wfExpandUrl( $remoteBasePath, PROTO_RELATIVE );
-
                return [ $localBasePath, $remoteBasePath ];
        }
 
@@ -366,7 +362,10 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
        public function getScriptURLsForDebug( ResourceLoaderContext $context ) {
                $urls = [];
                foreach ( $this->getScriptFiles( $context ) as $file ) {
-                       $urls[] = $this->getRemotePath( $file );
+                       $urls[] = OutputPage::transformResourcePath(
+                               $this->getConfig(),
+                               $this->getRemotePath( $file )
+                       );
                }
                return $urls;
        }
@@ -412,7 +411,10 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                foreach ( $this->getStyleFiles( $context ) as $mediaType => $list ) {
                        $urls[$mediaType] = [];
                        foreach ( $list as $file ) {
-                               $urls[$mediaType][] = $this->getRemotePath( $file );
+                               $urls[$mediaType][] = OutputPage::transformResourcePath(
+                                       $this->getConfig(),
+                                       $this->getRemotePath( $file )
+                               );
                        }
                }
                return $urls;