This is an automated email from the ASF dual-hosted git repository. jleroux pushed a commit to branch release18.12 in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/release18.12 by this push: new 8621ec88de Fixed: Update best-bet behavior in ContentUrlTag.java (OFBIZ-13217) 8621ec88de is described below commit 8621ec88de3e62f6346676620ff022063eb59fd5 Author: Jacques Le Roux <jacques.le.r...@les7arts.com> AuthorDate: Tue Mar 11 15:17:58 2025 +0100 Fixed: Update best-bet behavior in ContentUrlTag.java (OFBIZ-13217) If no.http is enable the best-bet behavior is to use secure prefix. Thanks: jovelromeo at https://github.com/apache/ofbiz-framework/pull/883/files Conflict handled by hand --- .../main/java/org/apache/ofbiz/webapp/taglib/ContentUrlTag.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/taglib/ContentUrlTag.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/taglib/ContentUrlTag.java index b130f86eff..8d5a3f5952 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/taglib/ContentUrlTag.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/taglib/ContentUrlTag.java @@ -46,8 +46,14 @@ public class ContentUrlTag { public static void appendContentPrefix(HttpServletRequest request, Appendable urlBuffer) throws IOException { if (request == null) { - Debug.logWarning("Request was null in appendContentPrefix; this probably means this was used where it shouldn't be, like using ofbizContentUrl in a screen rendered through a service; using best-bet behavior: standard prefix from url.properties (no WebSite or security setting known)", module); + Debug.logWarning("Request was null in appendContentPrefix; this probably means this was used where it shouldn't be, like using" + + " ofbizContentUrl in a screen rendered through a service; using best-bet behavior: standard prefix from url.properties" + + " or secure prefix if no.http is Y (no WebSite or security setting known)", module); String prefix = UtilProperties.getPropertyValue("url", "content.url.prefix.standard"); + String noHttp = UtilProperties.getPropertyValue("url", "no.http"); + if (noHttp != null && "Y".equals(noHttp)) { + prefix = UtilProperties.getPropertyValue("url", "content.url.prefix.secure"); + } if (prefix != null) { urlBuffer.append(prefix.trim()); }