@decocms/apps 1.6.2 → 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -100,7 +100,12 @@ export function getOptimizedMediaUrl(opts: OptimizationOptions): string {
100
100
  return optimizeShopify(originalSrc, width, height);
101
101
  }
102
102
 
103
- const imageSource = originalSrc.replace(DECO_CACHE_URL, "").replace(S3_URL, "").split("?")[0];
103
+ let imageSource = originalSrc.replace(DECO_CACHE_URL, "").replace(S3_URL, "").split("?")[0];
104
+
105
+ // Already on the image CDN — strip the host so we don't proxy through ourselves.
106
+ if (imageSource.startsWith(`https://${imageCdnDomain}/`)) {
107
+ imageSource = imageSource.slice(`https://${imageCdnDomain}`.length);
108
+ }
104
109
 
105
110
  const params = new URLSearchParams();
106
111
  params.set("fit", fit);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/apps",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "type": "module",
5
5
  "description": "Deco commerce apps for TanStack Start - Shopify, VTEX, commerce types, analytics utils",
6
6
  "exports": {