Subject: | Unexpected field value |
distibution: WWW-Mechanize [0.48]
perl: v5.8.0 built for MSWin32-x86-multi-thread
OS: windows XP prof SP1
I kept getting this error:
Uncaught exception from user code:
Unexpected field value http://www.jabberwacky.com/jtreply at (eval 6) line 1
HTTP::Headers::_header('HTTP::Headers=HASH 0x1e3b5c4)','Referer','URI::http=SCALAR(0x1a4a2c8)') called at d:/perl/site/lib/HTTP/Headers.pm line 150
HTTP::Headers::header('HTTP::Headers=HASH(0x1e3b5c4)') called at (eval 6) line 1
HTTP::Message::__ANON__('HTTP::Request=HASH(0x1e3b5dc)','Referer','URI::http=SCALAR(0x1a4a2c8)') called at d:/perl/site/lib/WWW/Mechanize.pm line 1027
WWW::Mechanize::request('WWW::Mechanize=HASH(0x186d0ec)','HTTP::Request=HASH(0x1e3b5dc)') called at d:/perl/site/lib/WWW/Mechanize.pm line 533
WWW::Mechanize::submit('WWW::Mechanize=HASH(0x186d0ec)') called at chat.pl line 11
I fixed it by changing line 1027 in Mechanize.pm from:
$request->header( Referer => $self->{last_uri} ) if $self->{last_uri);
to:
$request->header( Referer => "$self->{last_uri}" ) if $self->{last_uri);
it still seems to use the correct referer (checked with ethereal)
I don't know if this is a bug in WWW::Mechanize or in HTTP::Message:: but I've seen quite a few posts about getting a "Unexpected field value" while using Mechanized..
Kind regards,
Kender