libwww-perl / libwww-perl/HTTP-Message
HTTP::Config->match generates "uninitialized value" in matching method [rt.cpan.org #115670]
Open
Nobody has claimed this yet.
- Dominant language
- Perl
- Stars
- 32
- Forks
- 63
- Avg merge
- 5h 14m
- Merged PRs (30d)
- 1
Description
Migrated from rt.cpan.org#115670 (status was 'new')
Requestors:
- branislav.zahradnik@gooddata.com
From branislav.zahradnik@gooddata.com on 2016-06-28 13:24:50:
Use case: LWP::UserAgent response redirect handler with matching
specific response header, eg "Client-Warning"
Current code:
m_header__ => sub {
my($v, $k, $uri, $request, $response) = @_;
return unless $request;
return 1 if $request->header($k) eq $v;
return 1 if $response && $response->header($k) eq $v;
return 0;
},
Quick fix:
m_header__ => sub {
my($v, $k, $uri, $request, $response) = @_;
return unless $request;
return 1 if $request->header($k) && $request->header($k) eq $v;
return 1 if $response && $response->header($k) &&
$response->header($k) eq $v;
return 0;
},
or just disable warnings in those lamdas.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at HTTP::Config->match and reproduce the LWP::UserAgent response-redirect case using a specific response header such as "Client-Warning". Verify matching when request or response headers are absent; done means the match completes without an "uninitialized value" warning while preserving the expected header match.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- perl
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100