This is a multi-part message in MIME format.
------=_NextPart_000_0043_01BEC87D.EE92AE10
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
I am running a mod-perl script that retrieves web pages from the internet
using LWP::Parallel::UserAgent (it is the same for LWP).
I am having problems accessing some specific sites and after digging up a
bit I found out that the LWP is attaching to the http request header the
Authorization: Basic (the actual header line is:"Authorization: Basic
Lzo=").
I had a look at the http.pm file under the request method I found the
following:
sub write_request {
...
my $hhost = $url->authority;
$hhost =~ s/^([^\@]*)\@//; # get rid of potential "user:pass@"
$h->header('Host' => $hhost) unless defined $h->header('Host');
# add authorization header if we need them. HTTP URLs do
# not really support specification of user and password, but
# we allow it.
if (defined($1) && not $h->header('Authorization')) {
$h->authorization_basic(split(":", $1));
}
...
}
when the write_request function is called $1 is already set to "/" and since
the regular expression listed above is not met it stays "/".
And then the defined($1) is true and the authorization_basic function is
called.
I am running RedHat Linux 5.2 kernel 2.0.36 and Perl version 5.004_05.
mod_perl-1.19
LWP::Parallel::UserAgent version 5.43
The debug outpot is:
LWP::Parallel::Protocol::http::write_request: GET
/onlinecatalog/productdetail.pl?Number=99NBCAP HTTP/1.0
Authorization: Basic Lzo=
Host: www.buywiz.com
User-Agent: libwww-perl/5.43
Alon Shamir mailto:shamir@buywiz.com
------=_NextPart_000_0043_01BEC87D.EE92AE10
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
I am running a mod-perl script that = retrieves web=20 pages from the internet using LWP::Parallel::UserAgent (it is the same = for=20 LWP).
I am having problems accessing some specific sites and = after=20 digging up a bit I found out that the LWP is attaching to the http = request=20 header the Authorization: Basic (the actual header line = is:"Authorization: Basic=20 Lzo=3D").
I had a look at the http.pm file under the request = method I=20 found the following:
sub write_request {
...
my $hhost =3D $url->authority;
$hhost =3D~ s/^([^\@]*)\@//; # get rid of potential=20 "user:pass@"
$h->header('Host' =3D> $hhost) unless defined=20 $h->header('Host');
# add authorization header if we need them. HTTP URLs=20 do
# not really support specification of user and = password,=20 but
# we allow it.
if (defined($1) && not = $h->header('Authorization'))=20 {
$h->authorization_basic(split(":", $1));
}
...
}
when the write_request function is called $1 is = already set to=20 "/" and since the regular expression listed above is not met it stays=20 "/".
And then the defined($1) is true and the = authorization_basic=20 function is called.
I am running RedHat Linux 5.2 kernel 2.0.36 and Perl version = 5.004_05.=20
mod_perl-1.19
LWP::Parallel::UserAgent version 5.43
The debug outpot is:
LWP::Parallel::Protocol::http::write_request: GET=20 /onlinecatalog/productdetail.pl?Number=3D99NBCAP HTTP/1.0
Authorization: Basic Lzo=3D
Host: www.buywiz.com
User-Agent: libwww-perl/5.43
Alon Shamir
mailto:shamir@buywiz.com