Skip to content

Commit

Permalink
use compression when downloading feed logo
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Brahmer <[email protected]>
  • Loading branch information
Grotax committed Aug 21, 2023
1 parent ea88549 commit d51008c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Config/FetcherConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function __construct(IConfig $config)
*
* @return String list of supported encoding types
*/
private function checkEncoding()
public function checkEncoding()
{
$supportedEncoding = [];

Expand Down
4 changes: 3 additions & 1 deletion lib/Fetcher/FeedFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ protected function getFavicon(FeedInterface $feed, string $url): ?string
try {
// Base_uri can only be set on creation, will be used when link is relative.
$client = new Client(['base_uri' => $base_url]);
$fetcherConfig = new FetcherConfig();
$response = $client->request(
'GET',
$favicon,
Expand All @@ -409,7 +410,8 @@ protected function getFavicon(FeedInterface $feed, string $url): ?string
'headers' => [
'User-Agent' => FetcherConfig::DEFAULT_USER_AGENT,
'Accept' => 'image/*',
'If-Modified-Since' => date(DateTime::RFC7231, $last_modified)
'If-Modified-Since' => date(DateTime::RFC7231, $last_modified),
'Accept-Encoding' => $fetcherConfig->checkEncoding()
]
]
);
Expand Down

0 comments on commit d51008c

Please sign in to comment.