Net::HTTP does not play nicely with mod_gzip from apache.

  Net::HTTP sends 'TE:' headers, mod_gzip looks for 'Accept-encoding:'.


- Any chance 'Accept-encoding:' can be advertised and 'Content-Encoding:'
  results can be decoded by Net::HTTP sometime soon?

    Thanks,
      Mike Simons

information dump follows:
======

  I have checked the list archives since they moved to perl.org there
are only two useful posts on this issue:

On Tue, Aug 28, 2001 at 11:40:32AM -0700, Gisle Aas wrote:
> [EMAIL PROTECTED] writes:
> > Does the hew http 1.1 support include support for content-encoding
> > compression? (deflate, compress, gzip, etc.)
> 
> It supports using 'deflate' and 'gzip' in the Transfer-Encoding.
> 
> If compression is used in the Content-Encoding then the resulting
> $response->content would simply end up compressed.

On Tue, Sep 10, 2002 at 06:06:00PM -0700, Gisle Aas wrote:
> "Grant McLean" <[EMAIL PROTECTED]> writes:
> > I note that when I use the command-line GET script, the
> > outgoing headers include:
> > 
> >   TE: deflate,gzip;q=0.3
> > 
> > which seems to be being added by Net::HTTP::Methods
> > 
> > I'm assuming 'TE' is an abbreviation for Transfer-encoding.
> > Is this valid?  I can't see anything about it in the HTTP
> > RFC.
> 
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.39


  I'm still trying to parse the RFC on how things are supposed to work.

  Based on the comments above and some quick reading of Net/HTTP/Methods.pm
I know that Net::HTTP announces 'TE' support, which the server is
supposed to respond with Transfer-Encoding.  Something about 'chunked'
and 'trailer' transfer modes have some great effect on how things work.


On Mon, Mar 24, 2003 at 02:15:27AM -0500, Mike Simons wrote:
>   I'm having problems getting the Net::HTTP module to request and
> transfer Content-encoded (gzip) data streams.  I've change the code to
> request the content correctly so that mod_gzip in apache will send
> compressed streams, but when it arrives at user level it's is still
> compressed.
> 
> - Is content-encoded (gzip or deflate) mode supposed to work?
> - If yes, where can I find the source for a working version?

  Based on skimming mod_gzip.c from the apache module
(http://http.us.debian.org/debian/pool/main/liba/libapache-mod-gzip/libapache-mod-gzip_1.3.19.1a.orig.tar.gz)
I can see that it does not support the 'TE' method of compression.

  mod_gzip checks the 'Accept-Encoding' header to determine what 
compression should be applied to the outbound content.  I see a number
of web related programs (lynx, wget, mozilla) sucessfully transfering
compressed data this way, none of them advertise TE.


  Based on the description of TE is _seems_ to be more meant for escaping
data for non-8-bit clean or encyption purposes, not really compression
(but I don't understand the RFC in many places right now):

http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6
===
  Transfer-codings are analogous to the Content-Transfer-Encoding values
  of MIME [7], which were designed to enable safe transport of binary data
  over a 7-bit transport service. However, safe transport has a different
  focus for an 8bit-clean transfer protocol. In HTTP, the only unsafe
  characteristic of message-bodies is the difficulty in determining the
  exact body length (section 7.2.2), or the desire to encrypt data over a
  shared transport. 
===

Reply via email to