John Fessenden <[EMAIL PROTECTED]> writes: > I've discovered that If you set a Host header > > $r->header('Host', "host.host.com") > > on a request object. And use LWP::UserAgent::request() > to make the request, and follow redirects to the final result, > > The 'Host: ' header will persist on to each new Redirected request.
This is a bug. This patch ought to fix it: Index: lib/LWP/UserAgent.pm =================================================================== RCS file: /cvsroot/libwww-perl/lwp5/lib/LWP/UserAgent.pm,v retrieving revision 1.96 diff -u -p -u -r1.96 UserAgent.pm --- lib/LWP/UserAgent.pm 2001/09/20 00:14:26 1.96 +++ lib/LWP/UserAgent.pm 2001/10/13 01:37:48 @@ -472,6 +472,7 @@ sub request } $referral->url($referral_uri); + $referral->remove_header('Host'); return $response unless $self->redirect_ok($referral);