From: Eric Wong Date: Mon, 18 Jun 2012 20:50:06 +0000 (-0700) Subject: watcher: do not require Rack::Head for HEAD response X-Git-Tag: v0.10.0~1 X-Git-Url: https://repo.or.cz/w/raindrops.git/commitdiff_plain/cee9ca2bfd98b96cb8b956dd03fe03f313fee222 watcher: do not require Rack::Head for HEAD response Rack webservers are not guaranteed to include Rack::Head in the middleware stack. Watcher is a standalone app, so it cannot rely on a framework which automatically includes Rack::Head. --- diff --git a/lib/raindrops/watcher.rb b/lib/raindrops/watcher.rb index 5493374..43c30ef 100644 --- a/lib/raindrops/watcher.rb +++ b/lib/raindrops/watcher.rb @@ -143,8 +143,12 @@ class Raindrops::Watcher def call(env) @start.synchronize { @thr ||= aggregator_thread(env["rack.logger"]) } case env["REQUEST_METHOD"] - when "HEAD", "GET" + when "GET" get env + when "HEAD" + r = get(env) + r[2] = [] + r when "POST" post env else