This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch release24.09
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release24.09 by this push:
     new 5360d85a37 Fixed: Update best-bet behavior in ContentUrlTag.java 
(OFBIZ-13217)
5360d85a37 is described below

commit 5360d85a379289d4ed1eef70f38527defca992e0
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
---
 .../java/org/apache/ofbiz/webapp/taglib/ContentUrlTag.java     | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

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 70efec17dd..e908a7a485 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,10 +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());
             }

Reply via email to