diff --git a/src/Helper.php b/src/Helper.php index ba85203..d700069 100644 --- a/src/Helper.php +++ b/src/Helper.php @@ -5,6 +5,7 @@ use Carbon\Carbon; use Exception; use GuzzleHttp\Client; +use GuzzleHttp\Exception\ClientException; use GuzzleHttp\Exception\ConnectException; use Illuminate\Support\Collection; use Illuminate\Support\Str; @@ -138,6 +139,13 @@ public static function getHttpContentTypeForUrl(string $url, Client $httpClient) return $httpClient->get($url)->getHeaderLine('Content-Type'); } catch (ConnectException) { return null; + } catch (ClientException $exception) { + // return null for HTTP Not Found Exceptions + if ($exception->getResponse()->getStatusCode() === 404) { + return null; + } + + throw $exception; } }