From: Eric Wong <normalperson@yhbt.net>
To: rack-devel@googlegroups.com
Subject: Re: CommonLogger (and Clogger) generates strange symbols in the response body
Date: Fri, 4 Sep 2009 12:13:25 -0700 [thread overview]
Message-ID: <20090904191325.GA29915@dcvr.yhbt.net> (raw)
In-Reply-To: <cc1f582e0909040647w457c5b0bm2d67fc6e6aa2e6c7@mail.gmail.com>
Iñaki Baz Castillo <ibc@aliax.net> wrote:
> > 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.
No problem
> > 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.
Yes, however you might want to load the Rack::ContentLength middleware
in front of CommonLogger to ensure the length can get logged correctly
as a result.
--
Eric Wong
next prev parent reply other threads:[~2009-09-04 19:13 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
2009-09-04 19:13 ` Eric Wong [this message]
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=20090904191325.GA29915@dcvr.yhbt.net \
--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).