Skip Menu |
 

This queue is for tickets about the HTTP-Recorder CPAN distribution.

Report information
The Basics
Id: 11486
Status: resolved
Priority: 0/
Queue: HTTP-Recorder

People
Owner: Nobody in particular
Requestors: andrew.speer [...] isolutions.com.au
Cc:
AdminCc:

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

Attachments
HTTP-Recorder-0.02.diff



From: Andrew Speer <andrew.speer [...] isolutions.com.au>
To: bug-HTTP-Recorder [...] rt.cpan.org
Subject: Small fixes for HTTP::Recorder version 0.02
Date: Sun, 13 Feb 2005 15:25:18 +1030
CC: leira [...] cpan.org
Download (untitled) / with headers
text/plain 2.1k
Linda, Thank your for writing HTTP::Recorder, and making it publicly available on CPAN. I saw your article on perl.com and have been playing around with it recently. I had some problems: 1 .. I noticed that when used with HTTP::Proxy I could not longer login to some sites, eg Squirrel Mail on my local web host. Looking at the POST data from login it appears HTTP::Proxy is sending data similar to: login_username=usename&login_username=1&login_password=****&login_password=1, eg it was sending "field_name=1" for every field in the POST data. It looks like the culprit is in the 'unmodify' routine. I have altered it to get rid of the duplicate fields. 2 .. When it did load the SquirrelMail home page (which is frame based) HTTP::Recorder did not log the requests for the left and right frame content, nor any of the css sheets etc. It looks that you did that deliberately, but I wanted to catch those sort of subrequests, so I added a flag "ignore_referer" to the constructor, which if set to 1 will catch all subrequests. 3 .. My browser keeps on asking for "favicon.ico", which is logged by HTTP::Recorder (not so bad in itself), but it is logged before the field values are recorded by the script, ie the log looks like: $ua_or->get("http://copper.isolutions.com.au/webmail/src/login.php"); $ua_or->get("http://copper.isolutions.com.au/favicon.ico"); $ua_or->field("just_logged_in", "1"); $ua_or->field("login_username", "username"); $ua_or->field("js_autodetect_results", "1"); $ua_or->field("secretkey", "****"); $ua_or->submit_form(form_number => "1"); WWW::Mechanize then fails because it is trying to plug the field values into the response object for "favicon.ico", which has no fields. To get around this I changed your code to log requests *after* sending them, and then only if the response was successful (well, actually only if there was no error in the response, redirects count as "not successful"). Attached is a patch which applies all of the above, feel free to apply if you think they are warranted. I assign any copyrights to the patch over to you. Thanks again for your code, and hope the above info helps ... Andrew Speer

Message body is not shown because sender requested not to inline it.

Download (untitled) / with headers
text/plain 2.5k
Hi Andrew, Thanks for the feedback. I believe that all of these have been dealt with. The next developer release, 0.03_03, should be available soon. If it doesn't resolve all of these things, please enter more bugs for them (preferably one bug per issue, for easier tracking). Thanks, Linda [andrew.speer@isolutions.com.au - Sun Feb 13 00:03:45 2005]: Show quoted text
> Linda, > > Thank your for writing HTTP::Recorder, and making it publicly > available on > CPAN. I saw your article on perl.com and have been playing around with > it > recently. I had some problems: > > 1 .. I noticed that when used with HTTP::Proxy I could not longer > login to > some sites, eg Squirrel Mail on my local web host. Looking at the POST > data > from login it appears HTTP::Proxy is sending data similar to: > >
login_username=usename&login_username=1&login_password=****&login_password=1, Show quoted text
> > eg it was sending "field_name=1" for every field in the POST data. It > looks > like the culprit is in the 'unmodify' routine. I have altered it to > get rid of > the duplicate fields. > > 2 .. When it did load the SquirrelMail home page (which is frame > based) > HTTP::Recorder did not log the requests for the left and right frame > content, > nor any of the css sheets etc. It looks that you did that > deliberately, but I > wanted to catch those sort of subrequests, so I added a flag > "ignore_referer" > to the constructor, which if set to 1 will catch all subrequests. > > 3 .. My browser keeps on asking for "favicon.ico", which is logged by > HTTP::Recorder (not so bad in itself), but it is logged before the > field > values are recorded by the script, ie the log looks like: > > $ua_or->get("http://copper.isolutions.com.au/webmail/src/login.php"); > $ua_or->get("http://copper.isolutions.com.au/favicon.ico"); > $ua_or->field("just_logged_in", "1"); > $ua_or->field("login_username", "username"); > $ua_or->field("js_autodetect_results", "1"); > $ua_or->field("secretkey", "****"); > $ua_or->submit_form(form_number => "1"); > > WWW::Mechanize then fails because it is trying to plug the field > values into > the response object for "favicon.ico", which has no fields. > > To get around this I changed your code to log requests *after* sending > them, > and then only if the response was successful (well, actually only if > there > was no error in the response, redirects count as "not successful"). > > Attached is a patch which applies all of the above, feel free to apply > if you > think they are warranted. I assign any copyrights to the patch over to > you. > > Thanks again for your code, and hope the above info helps ... > > Andrew Speer


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.