Your message dated Fri, 8 Feb 2008 10:15:48 -0600
with message-id <[EMAIL PROTECTED]>
and subject line Bug caused due to wrongly following documentation
has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--- Begin Message ---
Package: libhttp-proxy-perl
Version: 0.19-1
Severity: normal
$ cat rot13
#!/usr/bin/perl
use strict;
use warnings;
use HTTP::Proxy;
use HTTP::Proxy::BodyFilter::simple;
my $proxy = new HTTP::Proxy();
$proxy->push_filter(response => new HTTP::Proxy::BodyFilter::simple(sub {
tr/a-zA-z/n-za-mN-ZA-M/; }));
$proxy->start();
$ ./rot13 2>/dev/null &
$ curl -x 127.0.0.1:8080 --include http://debian.org/
HTTP/1.1 302 Found
Date: Tue, 09 Jan 2007 17:21:40 GMT
Transfer-Encoding: chunked
Via: 1.1 cavendish (HTTP::Proxy/0.19)
Location: http://www.us.debian.org/
Server: Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-18 DAV/1.0.3
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>302 Found</TITLE>
</HEAD><BODY>
<H1>Found</H1>
The document has moved <A HREF="http://www.us.debian.org/">here</A>.<P>
<HR>
<ADDRESS>Apache/1.3.33 Server at debian.org Port 80</ADDRESS>
</BODY></HTML>
-- System Information:
Debian Release: 4.0
APT prefers testing
APT policy: (900, 'testing'), (600, 'unstable'), (500, 'experimental')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/dash
Kernel: Linux 2.6.18-3-686
Locale: LANG=C, LC_CTYPE=pl_PL (charmap=ISO-8859-2)
Versions of packages libhttp-proxy-perl depends on:
ii libwww-perl 5.805-1 WWW client/server library for Perl
ii perl 5.8.8-7 Larry Wall's Practical Extraction
libhttp-proxy-perl recommends no packages.
-- no debconf information
--
Jakub Wilk
--- End Message ---
--- Begin Message ---
Hi,
FWIW, I think you'd have much more fun (and might have resolved it
earlier) if you didn't calll rot13 with 2>/dev/null, as your version
yields the following warning:
Can't locate object method "filter" via package
"UGGC::Cebkl::ObqlSvygre::fvzcyr=UNFU(0k604160)" (perhaps you forgot to load
"UGGC::Cebkl::ObqlSvygre::fvzcyr=UNFU(0k604160)"?) at
/usr/share/perl5/HTTP/Proxy/FilterStack.pm line 126.
Of course... Out of curiosity, what is
rot13("UGGC::Cebkl::ObqlSvygre::fvzcyr=UNFU(0k604160)")? it is
HTTP::Proxy::BodyFilter::simple=HTML(0x604160)
So, the thing is the anonymous function was misconstructed - It
applied your rot13 to $_[0] (which happens to contain the object
reference - handily translated into a string, and then unable to be
used for anything else). You really wanted to modify $_[1], so your
code can be fixed with this patch:
--- rot13 2008-02-08 09:54:13.000000000 -0600
+++ rot13.fixed 2008-02-08 09:46:24.000000000 -0600
@@ -4,5 +4,5 @@
use HTTP::Proxy;
use HTTP::Proxy::BodyFilter::simple;
my $proxy = new HTTP::Proxy();
-$proxy->push_filter(response => new HTTP::Proxy::BodyFilter::simple(sub {
tr/a-zA-z/n-za-mN-ZA-M/; }));
+$proxy->push_filter(response => new HTTP::Proxy::BodyFilter::simple(sub { ${
$_[1] } =~ tr/a-zA-z/n-za-mN-ZA-M/; }));
$proxy->start();
As for Jay's version: Well, it works fine for me... Maybe the problem
is how you are calling curl? I don't have it installed, but used GET
(from libwww-perl) instead:
0 [EMAIL PROTECTED]/tmp$ GET -p http://localhost:8080/ http://www.debian.org/
hellohellohellohellohellohellohello
Greetings,
--
Gunnar Wolf - [EMAIL PROTECTED] - (+52-55)5623-0154 / 1451-2244
PGP key 1024D/8BB527AF 2001-10-23
Fingerprint: 0C79 D2D1 2C4E 9CE4 5973 F800 D80E F35A 8BB5 27AF
--- End Message ---