From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.1 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: yahns-public@yhbt.net Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 4DCBF1F980; Fri, 29 Apr 2016 07:57:50 +0000 (UTC) Date: Fri, 29 Apr 2016 07:57:50 +0000 From: Eric Wong To: yahns-public@yhbt.net Subject: [PATCH] document Rack::Chunked/ContentLength semi-requirements Message-ID: <20160429075750.GA4611@dcvr.yhbt.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline List-Id: Ugh, it sucks that other servers are so tolerant of violations of the Rack spec. Rainbows! had the same problem: https://bogomips.org/rainbows-public/20140704195032.GA13152@dcvr.yhbt.net/ --- Comments on wording clarity? Asynchronous spaghetti messed me brain up :X Documentation/yahns-rackup.pod | 10 ++++++++++ examples/yahns_rack_basic.conf.rb | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/Documentation/yahns-rackup.pod b/Documentation/yahns-rackup.pod index efdfb6d..6172661 100644 --- a/Documentation/yahns-rackup.pod +++ b/Documentation/yahns-rackup.pod @@ -159,6 +159,16 @@ The RACK_ENV variable is set by the aforementioned -E switch. If RACK_ENV is already set, it will be used unless -E is used. See rackup documentation for more details. +=head1 CAVEATS + +yahns is strict about buggy, non-compliant Rack applications. +Some existing servers work fine without "Content-Length" or +"Transfer-Encoding: chunked" response headers enforced by Rack::Lint. +Forgetting these headers with yahns causes clients to stall as they +assume more data is coming. Loading the Rack::ContentLength and/or +Rack::Chunked middlewares will set the necessary response headers +and fix your app. + =head1 CONTACT All feedback welcome via plain-text mail to L diff --git a/examples/yahns_rack_basic.conf.rb b/examples/yahns_rack_basic.conf.rb index f3f8e6a..610a482 100644 --- a/examples/yahns_rack_basic.conf.rb +++ b/examples/yahns_rack_basic.conf.rb @@ -30,6 +30,12 @@ worker_threads 50 end +# note: Rack requires responses set "Content-Length" or use +# "Transfer-Encoding: chunked". Some Rack servers tolerate +# the lack of these, yahns does not. Thus you should load +# Rack::Chunked and/or Rack::ContentLength middleware in your +# config.ru to ensure clients know when your application +# responses terminate. app(:rack, "config.ru", preload: false) do listen 80 -- EW