]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Post/Link.php
Check the edit date before storing history
[friendica.git] / src / Model / Post / Link.php
index 50ed12a36999250d3ba20af6655f5d1dfca0f11a..fb7d0edb8ddb88dccad5380e7f56dbc3853a32fc 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -26,6 +26,7 @@ use Friendica\Core\System;
 use Friendica\Database\Database;
 use Friendica\Database\DBA;
 use Friendica\DI;
+use Friendica\Network\HTTPClient\Client\HttpClientAccept;
 use Friendica\Network\HTTPClient\Client\HttpClientOptions;
 use Friendica\Util\Proxy;
 
@@ -96,11 +97,11 @@ class Link
                return $url . $id;
        }
 
-       private static function fetchMimeType(string $url)
+       private static function fetchMimeType(string $url, string $accept = HttpClientAccept::DEFAULT)
        {
                $timeout = DI::config()->get('system', 'xrd_timeout');
 
-               $curlResult = DI::httpClient()->head($url, [HttpClientOptions::TIMEOUT => $timeout]);
+               $curlResult = DI::httpClient()->head($url, [HttpClientOptions::TIMEOUT => $timeout, HttpClientOptions::ACCEPT_CONTENT => $accept]);
                if ($curlResult->isSuccess()) {
                        if (empty($media['mimetype'])) {
                                return $curlResult->getHeader('Content-Type')[0] ?? '';