tomMoulard / htransformation

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

fix: don't erase double headers with same name #48

Closed albttx closed 9 months ago

albttx commented 1 year ago

Currently, when there is 2 headers having the same name on a RewriteValueRule, the use of Header.Set will erase the previous one.

eg:

 http whoami.localhost 'set-cookie: test_1=42' 'set-cookie: test_2=43'
HTTP/1.1 200 OK
Content-Length: 430
Content-Type: text/plain; charset=utf-8
Date: Tue, 20 Jun 2023 10:33:05 GMT

Name: whoami
Hostname: f48f5d1ec863
IP: 127.0.0.1
IP: 172.20.0.3
RemoteAddr: 172.20.0.2:44670
GET / HTTP/1.1
Host: whoami.localhost
User-Agent: HTTPie/3.2.1
Accept: */*
Accept-Encoding: gzip, deflate
Set-Cookie: test_2=43; Domain=.example.com
[...]