Hi,
I am trying out Apache::Dynazip. All is well
using the IE browser. However, when I use curl (a nice
commandline web client), there are no contents coming back.
I have traced the cause of the problem to
the fact that I did not specify Accept-Encoding header
in curl which invoked a part of code in Apache::Dynazip
that skips compression. But that part seems buggy.
The bug seems to come from the part of the code:
my $headers = retrieve_all_cgi_headers_via ($fh);
$r->send_cgi_header($headers); # just for the case...
(line 862 of Apache::Dynagzip version 0.11). On line 44 we have:
sub retrieve_all_cgi_headers_via { # call model: my $hdrs =
retrieve_all_cgi_headers_via ($fh);
my $fh = shift;
my $headers;
{
local $/ = "\n\n";
$headers = <$fh>;
}
return $headers;
}
The problem is that my content generation module does not contain a
header section. In fact, I believe that in mod_perl, by default, there
will be no headers sent out. So the above code will actually read
the content as the value for $headers. Then when the time comes
to fetch the body content, it will be empty.
My current solution is to simply comment out the lines
my $headers = retrieve_all_cgi_headers_via ($fh);
$r->send_cgi_header($headers); # just for the case...
but I am wondering if this is a genuine bug in Apache::Dynazip
when the content does not come from cgi but mod_perl handler,
or I have used it inappropriately.
I think most people will not encounter this if they use IE/netscape
because these browsers set Accept-Encoding header by default.
But a well-behaved web site should be able to handle as many clients
as possible. So this problem is worth fixing.
Thanks for any info.
Richard
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html