This fixes the case of multiple headers of the same name (set-cookie being the
real world example I ran into) getting all smooshed together into a single
(invalid) header. Net::HTTP tries to be smart and join such headers with a ",
", which isn't so bad when immediately consuming the results, but wreaks havoc
when passing those headers through the proxy.
Treating the header values as arrays fixes this issue, as Rack happily does
the right thing and passes back a separate header for each value it sees in
the array.
This definitely has the potential for breakage, as it implicitly changes the
header portion of the triplet passed to #rewrite_response.
I tried to figure out how to write a test for this and came up empty. Best bet
is probably to have your trix.pl endpoint return a double header and verify
that rack-proxy does the right thing with it.
This fixes the case of multiple headers of the same name (set-cookie being the real world example I ran into) getting all smooshed together into a single (invalid) header. Net::HTTP tries to be smart and join such headers with a ", ", which isn't so bad when immediately consuming the results, but wreaks havoc when passing those headers through the proxy.
Treating the header values as arrays fixes this issue, as Rack happily does the right thing and passes back a separate header for each value it sees in the array.
This definitely has the potential for breakage, as it implicitly changes the header portion of the triplet passed to #rewrite_response.
I tried to figure out how to write a test for this and came up empty. Best bet is probably to have your trix.pl endpoint return a double header and verify that rack-proxy does the right thing with it.