Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the WWW-Mechanize CPAN distribution.

Report information
The Basics
Id: 6372
Status: resolved
Priority: 0/
Queue: WWW-Mechanize

People
Owner: Nobody in particular
Requestors: EHaimov [...] seic.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: "Unexpected Field Value" when using Mechanize::follow_link()
Date: Thu, 20 May 2004 17:07:24 -0400
From: "Haimov, Eugene" <EHaimov [...] seic.com>
To: <bug-WWW-Mechanize [...] rt.cpan.org.>
-------------------------- MODULE VERSION: -------------------------- Version 0.48 $Header: /cvsroot/www-mechanize/www-mechanize/lib/WWW/Mechanize.pm,v 1.13 2003/06/22 18:46:56 petdance Exp $ -------------------------- SYMPTOM: -------------------------- "Unexpected Field Value" error is reported when using Mechanize::follow_link() method. ROOT CAUSE: Mechanize::request() method sets the "Referer" header for the underlying request object using this code: $request->header( Referer => $self->{last_uri} ) if $self->{last_uri}; However, the $self->{last_uri} happens to be a ref to the object of type 'URI::http', This is then being passed to Headers.pm method _header(). There, the $val variable if checked to be either !ref($val), or ref($val)=='ARRAY', neither of which is the case. -------------------------- PROPOSED FIX: -------------------------- Use this code instead: $request->header( Referer => "$self->{last_uri}" ) if $self->{last_uri}; Note that here the $self->{last_uri} is enclosed in quotation marks which would effectively stringify the value before passing it in. -------------------------- AUTHOR: -------------------------- Eugene Haimov 5/20/2004 email: iiap623616@seic.com
Thanks for the heads-up and the workaround. It'll be in 1.04.