You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2012/10/06 12:59:12 UTC

svn commit: r1394995 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java

Author: jleroux
Date: Sat Oct  6 10:59:12 2012
New Revision: 1394995

URL: http://svn.apache.org/viewvc?rev=1394995&view=rev
Log:
A modified patch from  Jyoti Sharma https://issues.apache.org/jira/browse/OFBIZ-5043

When i worked with Url Rewrite Filter, i faced the following issue:-
In case of http protocol in the url, https links on th epage were not being rewritten and when their was https url, http links were not rewritten.

The issue behind this what i found is that in RequestHandler.java encodeUrl() is not called in the above given case.
So, if we place response.encodeUrl() their the issue is resolved. 

jleroux: This makes sense since we are still in the "if (encode) {" block. I just noticed that response != null was checked above so I placed the same check before encoding

Modified:
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java?rev=1394995&r1=1394994&r2=1394995&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java Sat Oct  6 10:59:12 2012
@@ -1137,8 +1137,11 @@ public class RequestHandler {
                         newURL.insert(questionIndex, sessionId);
                     }
                 }
-
-                encodedUrl = newURL.toString();
+                if (response != null) {
+                    encodedUrl = response.encodeURL(newURL.toString());
+                } else {
+                    encodedUrl = newURL.toString();    
+                }
             }
         } else {
             encodedUrl = newURL.toString();