From: Eric Wong <normalperson@yhbt.net>
To: raindrops@librelist.org
Subject: [PATCH 3/3] watcher: do not require Rack::Head for HEAD response
Date: Mon, 18 Jun 2012 14:20:45 -0700 [thread overview]
Message-ID: <1340054445-29631-4-git-send-email-normalperson@yhbt.net> (raw)
In-Reply-To: 1340054445-29631-1-git-send-email-normalperson@yhbt.net
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
--
1.7.11.rc0.55.gb2478aa
prev parent reply other threads:[~2012-06-18 21:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-18 21:20 [PATCH 0/3] preparing for raindrops 0.10.0 Eric Wong
2012-06-18 21:20 ` [PATCH 1/3] test_watcher: fix incorrect request/date comparison Eric Wong
2012-06-18 21:20 ` [PATCH 2/3] watcher: sort index of listener listing Eric Wong
2012-06-18 21:20 ` Eric Wong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://yhbt.net/raindrops/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1340054445-29631-4-git-send-email-normalperson@yhbt.net \
--to=normalperson@yhbt.net \
--cc=raindrops@librelist.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhbt.net/raindrops.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).