urlrewritefilter icon indicating copy to clipboard operation
urlrewritefilter copied to clipboard

Enable optional cookie forward mechanism in proxy mode

Open GoogleCodeExporter opened this issue 10 years ago • 4 comments

Current implementation will drop all cookies send by proxy destination. Such 
behavior could be expected in some cases (eg. to not override session id), but 
in other (like forwarding sign on request) is wrong.

In my case this assumption was wrong. I want to have all cookies send by 
proxied service in client. Therefore decided to add 'drop-cookies' parameter to 
'to' node of urlrewrite XML.

New 'drop-cookies' parameter by default is set to true to preserve current 
behavior, but when it will be changed then all cookies send by destination 
service will be forwarded to client (as expected in my use case)

I'm attaching patch file, hope that it will be merged soon ;)

Original issue reported on code.google.com by Dariusz.Luksza on 18 Sep 2013 at 9:51

Attachments:

GoogleCodeExporter avatar Jul 05 '15 22:07 GoogleCodeExporter

only in public class RequestProxy in setupProxyRequest its need to have boolean 
dropCookies parameter. And to add it in:

 } else if (dropCookies && headerName.toLowerCase().startsWith("cookie")) {
  //fixme : don't set any cookies in the proxied request, this needs a cleaner solution
                    continue;
 }

Original comment by [email protected] on 17 Nov 2014 at 1:43

GoogleCodeExporter avatar Jul 05 '15 22:07 GoogleCodeExporter

It works with this rule:

<rule>
        <condition name="host">sub.domain.com</condition>
        <from>^/(.*)</from>
        <to type="proxy" last="true" drop-cookies="false" qsappend="true">http://192.168.2.2/$1</to>
    </rule>

Original comment by [email protected] on 17 Nov 2014 at 1:46

GoogleCodeExporter avatar Jul 05 '15 22:07 GoogleCodeExporter

Hi guys,

Merged in the patch into forked repository at 
https://github.com/dmascord/urlrewritefilter

Cheers,

Damien

Original comment by [email protected] on 23 Mar 2015 at 3:45

GoogleCodeExporter avatar Jul 05 '15 22:07 GoogleCodeExporter

This would be a really useful feature!

coldsoul avatar Jul 14 '15 13:07 coldsoul