watcher: set Content-Type via assignment
authorEric Wong <normalperson@yhbt.net>
Thu, 11 Apr 2013 22:57:53 +0000 (11 22:57 +0000)
committerEric Wong <normalperson@yhbt.net>
Thu, 11 Apr 2013 22:59:01 +0000 (11 22:59 +0000)
Relying on String#replace to set Content-Type stopped working
with rack commit 3623d04526b953a63bfb3e72de2d6920a042563f
This fixes compatibility with the Rack 1.5.x series.

lib/raindrops/watcher.rb

index b7199a1..fb2df5b 100644 (file)
@@ -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