Skip Menu |

This queue is for tickets about the LWP-UserAgent-Determined CPAN distribution.

Report information
The Basics
Id: 96497
Status: resolved
Priority: 0/
Queue: LWP-UserAgent-Determined

People
Owner: Nobody in particular
Requestors: pagenyon [...] gmail.com
Cc:
AdminCc:

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



Subject: causes duplicate cookies
when debugging a failed request that ::Determined had retried several time, I noticed that all the cookie headers were duplicated the same number of times that the request had been retried. I tried with different timing() values to confirm. I think this can be trace back to LWP's use of a handler to set the cookies. It runs every time the request enters the request_prepare phase.
From: pagenyon [...] gmail.com
attached an example script demonstrating the issue. i think the solution is to remove the cookie header from the request before re-issuing it.
Subject: det.pl
#!/usr/bin/env perl use strict; use warnings; use LWP::UserAgent::Determined; my $ua = LWP::UserAgent::Determined->new( agent => 'Mozilla/5.0 Chrome/27.0.1453.93', timeout => 30, cookie_jar => {}, ); # Get the initial cookies. $ua->get('http://www.yahoo.com/'); # request an invalid subdomain. (results in a 500) $ua->timing(''); my $res = $ua->get('http://adfsas.dfssdfadsfadf.yahoo.com/'); print $res->request->headers->header('cookie'), "\n"; $ua->timing(1,1); $res = $ua->get('http://adfsas.dfssdfadsfadf.yahoo.com/'); print $res->request->headers->header('cookie'), "\n";
From: pagenyon [...] gmail.com
On Tue Jun 17 19:48:54 2014, pagenyon wrote: Show quoted text
> attached an example script demonstrating the issue. i think the > solution is to remove the cookie header from the request before re- > issuing it.
this indeed does solve the problem, but should done internally so everybody else doesn't have to implement this workaround: $ua->before_determined_callback(sub { my $req = $_[4][0]; $req->remove_header('cookie'); });
Subject: Re: [rt.cpan.org #96497] causes duplicate cookies
Date: Wed, 18 Jun 2014 13:34:41 -0400
To: bug-LWP-UserAgent-Determined [...] rt.cpan.org
From: Alex Vandiver <alexmv [...] bestpractical.com>
On 06/18/2014 01:09 PM, pagenyon via RT wrote: Show quoted text
> this indeed does solve the problem, but should done internally so > everybody else doesn't have to implement this workaround: > > $ua->before_determined_callback(sub { > my $req = $_[4][0]; > $req->remove_header('cookie'); > });
Jesse, this dist looks to be in your personal github repo (https://github.com/obra/lwp--useragent--determined ), not BPS', so I can't apply this and release it trivially. Would you like me to pull it into the BPS repos? - Alex
That'd be fantastic. Thank you/
Subject: Re: [rt.cpan.org #96497] causes duplicate cookies
Date: Tue, 24 Jun 2014 16:27:31 -0400
To: bug-LWP-UserAgent-Determined [...] rt.cpan.org
From: Alex Vandiver <alexmv [...] bestpractical.com>
On 06/17/2014 07:48 PM, pagenyon via RT wrote: Show quoted text
> attached an example script demonstrating the issue. i think the > solution is to remove the cookie header from the request before > re-issuing it.
Fixed in 1.07, just released to CPAN. - Alex