Merge "Revert "mediawiki.widgets: Add temporary workaround for upstream oojs-ui bug""
[lhc/web/wiklou.git] / includes / libs / MultiHttpClient.php
index b6aeda5..c6fa914 100644 (file)
@@ -55,6 +55,8 @@ class MultiHttpClient {
        protected $maxConnsPerHost = 50;
        /** @var string|null proxy */
        protected $proxy;
+       /** @var string */
+       protected $userAgent = 'wikimedia/multi-http-client v1.0';
 
        /**
         * @param array $options
@@ -345,7 +347,7 @@ class MultiHttpClient {
                }
 
                if ( !isset( $req['headers']['user-agent'] ) ) {
-                       $req['headers']['user-agent'] = self::userAgent();
+                       $req['headers']['user-agent'] = $this->userAgent;
                }
 
                $headers = array();
@@ -416,12 +418,4 @@ class MultiHttpClient {
                        curl_multi_close( $this->multiHandle );
                }
        }
-
-       /**
-        * The default User-Agent for requests.
-        * @return string
-        */
-       public static function userAgent() {
-               return 'wikimedia/multi-http-client v1.0';
-       }
 }