head fixings

This commit is contained in:
Philipp
2022-04-08 20:48:57 +02:00
parent 8e2cc678dc
commit 3033f79529
2 changed files with 4 additions and 2 deletions

View File

@@ -61,7 +61,7 @@ class ParseUrl
*/
public static function getContentType(string $url, string $accept = HttpClientAccept::DEFAULT)
{
$curlResult = DI::httpClient()->head($url);
$curlResult = DI::httpClient()->head($url, [HttpClientOptions::ACCEPT_CONTENT => $accept]);
// Workaround for systems that can't handle a HEAD request
if (!$curlResult->isSuccess() && ($curlResult->getReturnCode() == 405)) {