I've been trying to use Apache::GzipChain on my web server. Here is the configuration options I'm using httpd.conf:

<Directory "/path/to/dir"> AddHandler perl-script .cgi PerlHandler Apache::OutputChain Apache::GzipChain Apache::Registry allow from all PerlSendHeader On # Other stuff </Directory>

When I tried to access the front page with IE, the browser simply stoped. No error message, just stoped. So I tried connecting to the server via telnet like this:

$ telnet www.example.com 80 Trying 0.0.0.0... Connected to www.example.com. Escape character is '^]'. GET / HTTP/1.1 Host: example.com

And the response:

HTTP/1.1 200 OK Date: Fri, 13 Jun 2003 03:41:25 GMT Server: Apache/1.3.27 (Unix) Transfer-Encoding: chunked Content-Type: text/html fa1 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -- Rest of response unimportant --

My pages are generated from HTML::Template files, and they do have a valid DOCTYPE at the top, on the first line, with the second line starting the PUBLIC section. As you can see above, the first line is being cut off. I tried adding a blank line at the top in the template, but the behavior with IE remained (though a new telnet connect confirmed that the full DOCTYPE was being sent). Taking out the Apache::GzipChain in the chain caused it to work properly again.

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

Note: All code is untested, unless otherwise stated


In reply to Apache::GzipChain not sending first line of data by hardburn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.