[roch-pm] LWP and http_referer

Brian Mathis bmathis at directedge.com
Wed Dec 20 01:54:25 CST 2000


-----BEGIN PGP SIGNED MESSAGE-----

Justin C. Sherrill wrote:

 > Has anyone successfully faked the referring page for a LWP request
 > object? I've tried setting the value in the header when creating an
 > LWP::UserAgent, but no luck.
 >
 > I have a CGI I'm trying to steal results from, and it only returns
 > results if it sees a particular address as the referrer.

I can't remember if I've ever done this, but here's how I assume it
would work:

use LWP::UserAgent;
use HTTP::Request;
use HTTP::Headers;

$h = new HTTP::Headers;
&h->referer('http://rochester.pm.org');

$r = HTTP::Request->new(
GET => 'http://www.blah.com/x.cgi',
$h );

$ua = LWP::UserAgent->new;
$response = $ua->request($r);


- --
Brian Mathis
Direct Edge
http://www.directedge.com

-----BEGIN PGP SIGNATURE-----
Version: PGP Personal Privacy 6.5.8

iQCUAwUBOkBlrpwT6UbDtVwVAQH+9AP4m9qRtloHOQxi5W1BVnbDRiwBrAhl9oGq
k0YsU51kNzEKJLL81NlwzsBPMhlaECzAJJzVCRU1QQppTNK8KCG59A8XJtSUILLL
msaseY3GBH6rn0pwYeZE5RtG6F8bBiOa9JAVoGffXmdX/l6eGhbaDGR7GT6xZHJj
RluB5hwkJg==
=xpJR
-----END PGP SIGNATURE-----

--
For information on unsubscribing from this list, please visit
http://rochester.pm.org



More information about the Rochester-pm mailing list