Pass function name to HttpRequestFactory::create

Useful for logging
Replace deprecated MWHttpRequest::factory with service (since 1.32)

Change-Id: I81d8d350730f0f7da5cbf0a1463aaffbc07d2fab
This commit is contained in:
Umherirrender 2020-06-07 12:33:40 +02:00
parent c3cd62a2c1
commit 3df840d216
2 changed files with 4 additions and 3 deletions

View file

@ -16,7 +16,7 @@
],
"version": "2.25.1",
"requires": {
"MediaWiki": ">= 1.31.0"
"MediaWiki": ">= 1.32.0"
},
"license-name": "GPL-2.0-or-later",
"url": "https://www.mediawiki.org/wiki/Extension:RSS",

View file

@ -294,7 +294,7 @@ class RSSParser {
// we set followRedirects intentionally to true to see error messages
// in cases where the maximum number of redirects is reached
$client = MWHttpRequest::factory( $url,
$client = MediaWikiServices::getInstance()->getHttpRequestFactory()->create( $url,
[
'timeout' => $wgRSSFetchTimeout,
'followRedirects' => true,
@ -302,7 +302,8 @@ class RSSParser {
'proxy' => $wgRSSProxy,
'noProxy' => $noProxy,
'userAgent' => $wgRSSUserAgent,
]
],
__METHOD__
);
foreach ( $headers as $header => $value ) {