зеркало из https://github.com/nextcloud/news.git
also use url in user agent
This commit is contained in:
Родитель
d099f00e9a
Коммит
04fbad4554
|
@ -74,7 +74,9 @@ class FeedFetcher implements IFeedFetcher {
|
|||
$simplePie = $this->simplePieFactory->getCore();
|
||||
$simplePie->set_feed_url($url);
|
||||
$simplePie->enable_cache(true);
|
||||
$simplePie->set_useragent('ownCloud News/' . $this->appConfig->getConfig('version') . ' (+https://owncloud.org/; 1 subscriber)');
|
||||
$simplePie->set_useragent('ownCloud News/' .
|
||||
$this->appConfig->getConfig('version') .
|
||||
' (+https://owncloud.org/; 1 subscriber; feed-url=' . $url . ')');
|
||||
$simplePie->set_stupidly_fast(true); // disable simple pie sanitation
|
||||
// we use htmlpurifier
|
||||
$simplePie->set_timeout($this->fetchTimeout);
|
||||
|
|
|
@ -199,7 +199,9 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase {
|
|||
->with($this->equalTo($this->cacheDuration));
|
||||
$this->core->expects($this->once())
|
||||
->method('set_useragent')
|
||||
->with($this->equalTo('ownCloud News/3 (+https://owncloud.org/; 1 subscriber)'));
|
||||
->with($this->equalTo(
|
||||
'ownCloud News/3 (+https://owncloud.org/; 1 subscriber; ' .
|
||||
'feed-url=http://tests)'));
|
||||
$this->setExpectedException('\OCA\News\Fetcher\FetcherException');
|
||||
$this->fetcher->fetch($this->url);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче