From cee9ca2bfd98b96cb8b956dd03fe03f313fee222 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 18 Jun 2012 13:50:06 -0700 Subject: 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. --- lib/raindrops/watcher.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3-24-ge0c7