Message->parse() is incompatible with header()
FGasper opened this issue · comments
Felipe Gasper commented
perl -MData::Dumper -MHTTP::Response -e'my $hdr = HTTP::Response->parse("HTTP/1.0 200 OK\r\na-b_c: haha\r\n\r\n"); print Dumper $hdr; print $hdr->header("a-b_c");'
^^ The above will show that haha
isn’t printed. The Dumper output shows that the header is stored internaly as a-b_c
, but when we go to fetch that value we get nothing because fetch() is looking for a-b-c
.
I don’t see any outstanding issues about this. Without knowing why Message->parse() disables the underscore translation I‘m not sure what the proper fix would be. Maybe make header() search for the original as well as the hyphen-replaced version?
Olaf Alders commented
@vanHoesel thoughts on this?