ofbiz-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacques Le Roux" <jacques.le.r...@les7arts.com>
Subject Re: Url Rewrite Filter does not work on switching protocol
Date Mon, 24 Sep 2012 07:04:39 GMT
Please yes submit a patch for review, even if what you say is quite clear, it's easier to focus/share
there then
I guess you already know https://cwiki.apache.org/confluence/display/OFBADMIN/OFBiz+Contributors+Best+Practices
?

Thanks

Jacques

From: "jyoti" <jyoti.sharma@viithiisys.com>
> Hi,
>    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=" +
> request.getSession().getId();
>                    // 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) {
>                        newURL.append(sessionId);
>                    } 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. 

Mime
View raw message