]> _ Git - cubist_cms-back.git/commitdiff
wait #7673 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 31 Jul 2025 07:28:32 +0000 (09:28 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 31 Jul 2025 07:28:32 +0000 (09:28 +0200)
src/routes/cubist/backpack/cdnproxy.php

index a320627c075dfdaec2e5fc34181e7860d961018d..1fc81548997adbced7ae34f3d3b40ad43851fac8 100644 (file)
@@ -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)) {