rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
From: "Iñaki Baz Castillo" <ibc@aliax.net>
To: rack-devel@googlegroups.com
Subject: Re: CommonLogger (and Clogger) generates strange symbols in the  response body
Date: Fri, 4 Sep 2009 15:47:27 +0200	[thread overview]
Message-ID: <cc1f582e0909040647w457c5b0bm2d67fc6e6aa2e6c7@mail.gmail.com> (raw)
In-Reply-To: <20090904013525.GA12750@dcvr.yhbt.net>


2009/9/4 Eric Wong <normalperson@yhbt.net>:
>> As you can see, the number above each real body line is the length of the line
>> below it (in hexadecimal when > 10).
>
> This is chunked transfer encoding as defined in rfc 2616, section 3.6.1.
> Any HTTP/1.1 client should be able to interpret and decode it correctly.

Thanks a lot, I didn't know it.


> Both CommonLogger (from Rack 1.0) and Clogger (by default) wraps the
> original response body with something that responds to #each to
> correctly calculate the size of the body.  This can throw off the
> Rack::ContentLength middleware that your server probably already loads
> for you (the Thin and Mongrel handlers both appear to load both
> Rack::Chunked and Rack::ContentLength).
>
> For performance reasons, the next version of Rack will instead log the
> existing "Content-Length" header if one exists, and '-' if it doesn't;
> skipping the wrapping of the body[1].

Does it mean that with the next version I would get a non chunked
transfer encoded body even if I use CommonLogger?

Thanks a lot.


-- 
Iñaki Baz Castillo
<ibc@aliax.net>

  reply	other threads:[~2009-09-04 13:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-03 23:02 CommonLogger (and Clogger) generates strange symbols in the response body Iñaki Baz Castillo
2009-09-03 23:28 ` Iñaki Baz Castillo
2009-09-04  1:35 ` Eric Wong
2009-09-04 13:47   ` Iñaki Baz Castillo [this message]
2009-09-04 19:13     ` Eric Wong
2009-09-04 19:20       ` Iñaki Baz Castillo
2009-09-04 19:42         ` Eric Wong
2009-09-04 19:44           ` Iñaki Baz Castillo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://groups.google.com/group/rack-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cc1f582e0909040647w457c5b0bm2d67fc6e6aa2e6c7@mail.gmail.com \
    --to=rack-devel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).