1
0
Fork 0

head fixings

This commit is contained in:
Philipp Holzer 2022-04-08 20:48:57 +02:00
commit 3033f79529
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432
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)) {