Created
October 16, 2009 09:34
-
-
Save harukizaemon/211675 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rack' | |
module Rack | |
class Pot | |
CONTENT_TYPE = "application/coffee-pot-command".freeze | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
if env["CONTENT_TYPE"] == CONTENT_TYPE | |
["418 I'm a teapot", {"Content-Type" => CONTENT_TYPE, "Content-Length" => "0"}, []] | |
else | |
@app.call(env) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment