Subject: | [patch] HTTP::DAV::UserAgent breaks LWP::UserAgent |
redefining LWP::UserAgent::redirect_ok in HTTP::DAV::UserAgent means
that software which uses LWP::UserAgent and HTTP::DAV can break in
unexpected ways.
We had a script which webscraped some data and generated reports.
Adding functionality to upload the reports to a web server for
publication broke the webscraping.
Using inheritence seem more sensible.
Subject: | httpdav.patch |
Index: HTTP-DAV/DAV/Comms.pm
===================================================================
RCS file: /cvsroot/upstream/HTTP-DAV/DAV/Comms.pm,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Comms.pm
--- HTTP-DAV/DAV/Comms.pm 6 Apr 2002 17:45:42 -0000 1.1.1.1
+++ HTTP-DAV/DAV/Comms.pm 31 May 2006 12:47:29 -0000
@@ -10,11 +10,6 @@
use strict;
use vars qw($VERSION $DEBUG);
-{
- no warnings;
- BEGIN { *LWP::UserAgent::redirect_ok = sub { 0 } }
-}
-
####
# Construct a new object and initialize it
@@ -312,6 +307,10 @@
$self;
}
+ sub redirect_ok {
+ return 0;
+ }
+
sub credentials {
my($self, $netloc, $realm,$user,$pass) = @_;
$realm = "default" unless $realm;