yahns Ruby server user/dev discussion
 help / color / mirror / Atom feed
* [PATCH] document Rack::Chunked/ContentLength semi-requirements
@ 2016-04-29  7:57 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2016-04-29  7:57 UTC (permalink / raw)
  To: yahns-public

Ugh, it sucks that other servers are so tolerant of violations
of the Rack spec.  Rainbows! had the same problem:

 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<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 @@
   worker_threads 50
+# 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-29  7:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-29  7:57 [PATCH] document Rack::Chunked/ContentLength semi-requirements Eric Wong

yahns Ruby server user/dev discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhbt.net/yahns-public
	git clone --mirror http://ou63pmih66umazou.onion/yahns-public

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 yahns-public yahns-public/ https://yhbt.net/yahns-public \
		yahns-public@yhbt.net yahns-public@rubyforge.org
	public-inbox-index yahns-public

Example config snippet for mirrors.
Newsgroups are available over NNTP:
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for the project(s) associated with this inbox:


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git