Skip to content

Instantly share code, notes, and snippets.

@harukizaemon
Created October 16, 2009 09:34
Show Gist options
  • Save harukizaemon/211675 to your computer and use it in GitHub Desktop.
Save harukizaemon/211675 to your computer and use it in GitHub Desktop.
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