mirror of
https://github.com/friendica/friendica
synced 2025-05-01 08:24:23 +02:00
Lemmy support added
This commit is contained in:
parent
732663ea6b
commit
43b9e39c6a
2 changed files with 47 additions and 1 deletions
|
@ -60,6 +60,12 @@ class ParseUrl
|
|||
public static function getContentType(string $url)
|
||||
{
|
||||
$curlResult = DI::httpClient()->head($url);
|
||||
|
||||
// Workaround for systems that can't handle a HEAD request
|
||||
if (!$curlResult->isSuccess() && ($curlResult->getReturnCode() == 405)) {
|
||||
$curlResult = DI::httpClient()->get($url, [HttpClientOptions::CONTENT_LENGTH => 1000000]);
|
||||
}
|
||||
|
||||
if (!$curlResult->isSuccess()) {
|
||||
return [];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue