From f3e4a121d9d61c5aec7549177c5693db3e9d7ca8 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 31 Jul 2025 09:28:32 +0200 Subject: [PATCH] wait #7673 @0.5 --- src/routes/cubist/backpack/cdnproxy.php | 9 +++++++++ 1 file changed, 9 insertions(+) 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)) { -- 2.39.5