Merge "Minor fixes to ParsoidVirtualRESTService"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sun, 10 Sep 2017 01:11:30 +0000 (01:11 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 10 Sep 2017 01:11:30 +0000 (01:11 +0000)
includes/libs/virtualrest/ParsoidVirtualRESTService.php

index a148a39..b03a647 100644 (file)
@@ -58,15 +58,14 @@ class ParsoidVirtualRESTService extends VirtualRESTService {
                        'url' => 'http://localhost:8000/',
                        'prefix' => 'localhost',
                        'domain' => 'localhost',
+                       'timeout' => null,
                        'forwardCookies' => false,
                        'HTTPProxy' => null,
                ], $params );
                // Ensure that the url parameter has a trailing slash.
-               $mparams['url'] = preg_replace(
-                       '#/?$#',
-                       '/',
-                       $mparams['url']
-               );
+               if ( substr( $mparams['url'], -1 ) !== '/' ) {
+                       $mparams['url'] .= '/';
+               }
                // Ensure the correct domain format: strip protocol, port,
                // and trailing slash if present.  This lets us use
                // $wgCanonicalServer as a default value, which is very convenient.