libwww-perl / libwww-perl/HTTP-Message

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

Open
#147 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Perl
Stars
32
Forks
63
Avg merge
5h 14m
Merged PRs (30d)
1

Description

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supplied Perl reproducer, then trace HTTP::Response->parse, header(), and the underlying fetch() normalization. Determine why underscores are retained during parsing but queried as hyphens; done means header("a-b_c") returns "haha" consistently, with regression coverage for the reproducer.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
43/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.