From ec562c1b2c8b35fb7a550d3811c8bf00fed0cbf5 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Mon, 23 Feb 2026 14:03:17 +0100 Subject: [PATCH] fix: imgproxy issues --- .env | 2 +- packages/content-engine/package.json | 2 +- packages/image-processor/src/processor.ts | 26 ++++++++++++++++++++++- packages/meme-generator/package.json | 2 +- packages/thumbnail-generator/package.json | 2 +- 5 files changed, 29 insertions(+), 5 deletions(-) diff --git a/.env b/.env index 4ec0554..2097c88 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ # Project -IMAGE_TAG=v1.8.16 +IMAGE_TAG=v1.8.19 PROJECT_NAME=at-mintel PROJECT_COLOR=#82ed20 GITEA_TOKEN=ccce002e30fe16a31a6c9d5a414740af2f72a582 diff --git a/packages/content-engine/package.json b/packages/content-engine/package.json index 85e42b8..3a83faf 100644 --- a/packages/content-engine/package.json +++ b/packages/content-engine/package.json @@ -1,7 +1,7 @@ { "name": "@mintel/content-engine", "version": "1.8.19", - "private": true, + "private": false, "type": "module", "main": "./dist/index.js", "module": "./dist/index.js", diff --git a/packages/image-processor/src/processor.ts b/packages/image-processor/src/processor.ts index c6d8c71..09e134c 100644 --- a/packages/image-processor/src/processor.ts +++ b/packages/image-processor/src/processor.ts @@ -15,7 +15,31 @@ export interface ProcessImageOptions { export function mapUrl(url: string, mappingString?: string): string { if (!mappingString) return url; - const mappings = mappingString.split(",").map((m) => m.split(":")); + const mappings = mappingString.split(",").map((m) => { + if (m.includes("|")) { + return m.split("|"); + } + + // Legacy support for simple "host:target" or cases where one side might have a protocol + // We try to find the split point that isn't part of a protocol "://" + const colonIndices = []; + for (let i = 0; i < m.length; i++) { + if (m[i] === ":") { + // Check if this colon is part of "://" + if (!(m[i + 1] === "/" && m[i + 2] === "/")) { + colonIndices.push(i); + } + } + } + + if (colonIndices.length === 0) return [m]; + + // In legacy mode with colons, we take the LAST non-protocol colon as the separator + // This handles "http://host:port" or "host:http://target" better + const lastColon = colonIndices[colonIndices.length - 1]; + return [m.substring(0, lastColon), m.substring(lastColon + 1)]; + }); + let mappedUrl = url; for (const [match, replace] of mappings) { diff --git a/packages/meme-generator/package.json b/packages/meme-generator/package.json index 03eee46..b0721da 100644 --- a/packages/meme-generator/package.json +++ b/packages/meme-generator/package.json @@ -1,7 +1,7 @@ { "name": "@mintel/meme-generator", "version": "1.8.19", - "private": true, + "private": false, "type": "module", "main": "./dist/index.js", "module": "./dist/index.js", diff --git a/packages/thumbnail-generator/package.json b/packages/thumbnail-generator/package.json index c028a13..72a5aaa 100644 --- a/packages/thumbnail-generator/package.json +++ b/packages/thumbnail-generator/package.json @@ -1,7 +1,7 @@ { "name": "@mintel/thumbnail-generator", "version": "1.8.19", - "private": true, + "private": false, "type": "module", "main": "./dist/index.js", "module": "./dist/index.js",