On Mon, Dec 22, 2008 at 10:47:18AM -0600, Gunnar Wolf wrote:

> I am a member of the Debian pkg-perl group [1]. I stumbled upon a test
> failure when rebuilding - For further information on my build
> environment, please refer to the bug report in the Debian BTS [2].
> 
> The test failure appears on hooks/authz.t:
> 
>     Test Summary Report
>     -------------------
>     t/hooks/authz                       (Wstat: 0 Tests: 4 Failed: 1)
>     Failed test:  4

This broke when libwww-perl was upgraded from 5.813 to 5.820.
It still happens with the current version, 5.822.

This changelog entry seems relevant:

 2008-09-24  Release 5.815
 [...]
 Also thanks to contributions by Bron Gondwana LWP's Basic/Digest
 authenticate modules now registers handlers which allow them to
 automatically fill in the Authorization headers without first taking
 the round-trip of a 401 response when LWP knows the credentials for a
 given realm.

My limited understanding of this is that it's a bug in LWP: the
new handler installed by LWP::Authen::Basic::authenticate() uses
$ua->credentials() instead of $ua->get_basic_credentials(). However,
the LWP::UserAgent documentation recommends that subclasses override
just get_basic_credentials(), and that's what Apache::TestRequest
currently does.

The attached patch works around the problem by providing a credentials()
wrapper too. It's probably not quite correct, but the tests pass with
this on both libwww-perl 5.813 and 5.822.
-- 
Niko Tyni   nt...@debian.org
Index: Apache-Test/lib/Apache/TestRequest.pm
===================================================================
--- Apache-Test/lib/Apache/TestRequest.pm	(revision 28483)
+++ Apache-Test/lib/Apache/TestRequest.pm	(working copy)
@@ -256,6 +256,11 @@
     $self;
 }
 
+sub credentials {
+    my $self = shift;
+    return $self->get_basic_credentials(@_);
+}
+
 sub get_basic_credentials {
     my($self, $realm, $uri, $proxy) = @_;
 

Reply via email to