griswold / urlrewritefilter

Automatically exported from code.google.com/p/urlrewritefilter
Other
0 stars 0 forks source link

Enable optional cookie forward mechanism in proxy mode #149

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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 commented 9 years ago
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 syt...@gmail.com on 17 Nov 2014 at 1:43

GoogleCodeExporter commented 9 years ago
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 syt...@gmail.com on 17 Nov 2014 at 1:46

GoogleCodeExporter commented 9 years ago
Hi guys,

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

Cheers,

Damien

Original comment by dmasc...@gmail.com on 23 Mar 2015 at 3:45