Skip to content

Message->parse() is incompatible with header() #147

@FGasper

Description

@FGasper
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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions