From: Paul Donald Date: Thu, 5 Feb 2026 17:06:43 +0000 (+0100) Subject: luci-app-dockerman: jsmin workaround X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=f0ff5612a1200803069fab48fa0521909e6a8e48;p=project%2Fluci.git luci-app-dockerman: jsmin workaround jsmin state machine is basic so it fails on this: return /^https?:\/\//i.test(addr) interpreting the final // as comment start, not recognizing it is in a regex. But if we wrap the regex in () then all is well. jsmin has the comment: action recognizes a regular expression if it is preceded by the likes of '(' or ',' or '='. Signed-off-by: Paul Donald --- diff --git a/applications/luci-app-dockerman/htdocs/luci-static/resources/dockerman/common.js b/applications/luci-app-dockerman/htdocs/luci-static/resources/dockerman/common.js index 688212bb7f..9cc092dcac 100644 --- a/applications/luci-app-dockerman/htdocs/luci-static/resources/dockerman/common.js +++ b/applications/luci-app-dockerman/htdocs/luci-static/resources/dockerman/common.js @@ -742,7 +742,10 @@ const dv = view.extend({ ensureRegistryScheme(address, hostFallback) { const addr = String(address || '').trim() || hostFallback; if (!addr) return null; - return /^https?:\/\//i.test(addr) ? addr : `https://${addr}`; + /* jsmin cannot handle /^https?:\/\//i.test(addr) - wrap in parentheses: OK + https = new RegExp('https?:\/\/', 'i'); // also OK + */ + return (/^https?:\/\//i.test(addr)) ? addr : `https://${addr}`; }, /**