Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: Marek.Rouchal [...] gmx.net
Cc:
AdminCc:

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



Subject: unmodify gets also strings, not only objects
I just set up HTTP::Recorder here (perl-5.8.7, with gcc-3.4.4, all latest modules like HTTP::Proxy, WWW::Mechanize etc. as of Nov-21), tried it on one of our internal websites and noticed a problem in sub unmodify: the $content is sometimes a string, not an object. I hacked the following lines in and it seems to work ok; however, I could imagine that there is a smarter and cleaner solution; the string appears when unmodify is called with $req->content, not with $req->uri. --- lib/HTTP/Recorder.pm 2005-08-19 05:05:54.000000000 +0200 +++ /opt/perl_5.8.7/lib/HTTP/Recorder.pm 2005-11-21 12:20:33.796981000 +0100 @@ -344,6 +344,12 @@ # get rid of the arguments we added my $prefix = $self->{prefix}; + # workaround: the content can be a simple string + unless(ref $content) { + $content =~ s/(?:^|(?<=\&))\Q$prefix\E-[^=]+=[^\&]*(\&|$)//g; + return $content; + } + for my $key ($content->query_param) { if ($key =~ /^$prefix-/) { $content->query_param_delete($key); By the way: The web site uses Javascript, and there is this code in: if (window.parent&&window.parent.content) window.parent.content.location.href='/cqWEB/query/scrolledlist/viewbug_c ontent.asp?ChangeState=T&newstate='+fasn[ix]; This code seems to merely open the given URL - any idea why this is not caught by HTTP::Recorder when I execute it? This is not a showstopper since I can manually add this link to the WWW::Mechanize script, but of course it would be nice if the H::R would get it right itself. Thanks for this great utility! -Marek (one of the Munich.pm's)
Thanks for the patch, it was added to the release. This module does not handle JS requests. - Shmuel.