From: Vincent Vanwaelscappel Date: Thu, 31 Jul 2025 07:28:32 +0000 (+0200) Subject: wait #7673 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=f3e4a121d9d61c5aec7549177c5693db3e9d7ca8;p=cubist_cms-back.git wait #7673 @0.5 --- diff --git a/src/routes/cubist/backpack/cdnproxy.php b/src/routes/cubist/backpack/cdnproxy.php index a320627..1fc8154 100644 --- a/src/routes/cubist/backpack/cdnproxy.php +++ b/src/routes/cubist/backpack/cdnproxy.php @@ -11,6 +11,15 @@ Route::group([ $url = 'https://' . $url; $e = explode('.', $url); $ext = array_pop($e); + + if (stristr($url, 'unpkg.com') && stristr($ext, 'com')) { + $ext = cache()->rememberForever('unpkg_ext_' . $url, function () use ($url) { + $url = \Cubist\Net\Util::getFinalURL($url); + $e = explode('.', $url); + return array_pop($e); + }); + } + $cache = \Cubist\Util\Files\Files::mkdir(storage_path('app/cache/cdnproxy')) . sha1($url) . '.' . $ext; if (!file_exists($cache) || filemtime($cache) < (time() - 604800)) {