tomMoulard / htransformation

A Traefik plugin to change on the fly header's value of a request
MIT License
77 stars 13 forks source link

SetOnResponse with RewriteValueRule v0.2.7 doesn't work #50

Open kanchev1 opened 1 year ago

kanchev1 commented 1 year ago

Hi,

Thanks for your work on this great plugin, it'd be amazing if the response header manipulation works!

I have a simple rule to remove the Secure flag of a cookie:

            - Rule:
              Name: 'Unsecure Cookie'
              Header: 'Set-Cookie'
              Value: '(.*)Secure(.*)'
              ValueReplace: 'BABLA-$1-$2'
              Type: 'RewriteValueRule'
              SetOnResponse: true

This is simply a basic test rule to check if it's working at all. The cookies in the response are unchanged.

The plugin actually works on my configuration since I also Set some request headers.

I'm using traefik 2.10.4.

UPDATE: The following plugin seems to be the only one able to modify the response headers correctly: https://github.com/XciD/traefik-plugin-rewrite-headers

I-lander commented 7 months ago

@kanchev1 Hi guy. I'm facing the same issue but the plugin rewrite headers is not better... How did you manage to handle it ?

here is my dynamic-conf

http: middlewares: test: plugin: rewriteHeaders: rewrites: