From: Eric Wong Date: Thu, 11 Apr 2013 22:57:53 +0000 (+0000) Subject: watcher: set Content-Type via assignment X-Git-Tag: v0.11.0~6 X-Git-Url: https://repo.or.cz/w/raindrops.git/commitdiff_plain/c29fd663b45888aa8661c8599c88c339f4fbe8c1 watcher: set Content-Type via assignment Relying on String#replace to set Content-Type stopped working with rack commit 3623d04526b953a63bfb3e72de2d6920a042563f This fixes compatibility with the Rack 1.5.x series. --- diff --git a/lib/raindrops/watcher.rb b/lib/raindrops/watcher.rb index b7199a1..fb2df5b 100644 --- a/lib/raindrops/watcher.rb +++ b/lib/raindrops/watcher.rb @@ -323,7 +323,7 @@ class Raindrops::Watcher res = Rack::Response.new url = req.referer || "#{req.host_with_port}/" res.redirect(url) - res.content_type.replace "text/plain" + res["Content-Type"] = "text/plain" res.write "Redirecting to #{url}" res.finish end