ofbiz-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jyoti <jyoti.sha...@viithiisys.com>
Subject Url Rewrite Filter does not work on switching protocol
Date Sat, 22 Sep 2012 17:18:45 GMT
    I have been working with url rewrite filter since last few days. All the
rules worked fine except outbound-rules. I faced following problem:-

When their was a http request none of the https links on the page were being
rewritten and in case of https request http links did not work.
The reason of this was that all the urls are rewritten only when encodeUrl()
function is called. And in ofbiz encodeUrl is not being called when there is
a protocol switch.

Following is the code of RequestHandler.java regarding this.
if (response != null && !forceManualJsessionid && !isSpider) {
                encodedUrl = response.encodeURL(newURL.toString());
            } else {
                if (!isSpider) {
                    String sessionId = ";jsessionid=" +
                    // this should be inserted just after the "?" for the
parameters, if there is one, or at the end of the string
                    int questionIndex = newURL.indexOf("?");
                    if (questionIndex == -1) {
                    } else {
                        newURL.insert(questionIndex, sessionId);
                encodedUrl = newURL.toString();
If we replace "encodedUrl = newURL.toString()" in the else portion with
"response.encodeURL(newURL.toString())" the problem is solved.

Should i submit this patch in the jira?

View this message in context: http://ofbiz.135035.n4.nabble.com/Url-Rewrite-Filter-does-not-work-on-switching-protocol-tp4636429.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

View raw message