kubo39 / bossan

high performance asynchronous rack web server
Other
28 stars 5 forks source link

How to avoid raising StopIteration when response body is empty. #10

Closed kubo39 closed 11 years ago

kubo39 commented 11 years ago

In case this rack app:

app = lambda do |env|
  [200, {'Content-Type'=> 'text/plain'}, []]
end

It raises StopIteraion, and server goes down.

How to avoid this?

  1. server gets response body is empy.
  2. using rb_rescue.

or your suggestion, please!

kubo39 commented 11 years ago

Thin とかではレスポンスボディが空の配列の場合はそのまま空文字列と同じように扱っているみたい。 Rack仕様はとくにこのケースにかんしての言及ないみたいなのでサーバ側の実装依存?