about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--Documentation/yahns-rackup.pod10
-rw-r--r--examples/yahns_rack_basic.conf.rb6
-rw-r--r--extras/exec_cgi.rb8
3 files changed, 24 insertions, 0 deletions
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<mailto:yahns-public@yhbt.net>
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 @@ queue do
   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
 
diff --git a/extras/exec_cgi.rb b/extras/exec_cgi.rb
index 3091cfb..6bb40c1 100644
--- a/extras/exec_cgi.rb
+++ b/extras/exec_cgi.rb
@@ -12,6 +12,14 @@
 #  (delfater: ensure that parent body is always closed)
 # Otherwise you will get zombies from HEAD requests which accept compressed
 # responses.
+#
+# Usage in config.ru using cgit as an example:
+#
+#   use Rack::Chunked
+#   # other Rack middlewares can go here...
+#
+#   run ExecCgi.new('/path/to/cgit.cgi') # cgit: https://git.zx2c4.com/cgit/
+#
 class ExecCgi
   class MyIO < Kgio::Pipe
     attr_writer :my_pid