Skip to content

Instantly share code, notes, and snippets.

@harukizaemon
Created October 15, 2009 11:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save harukizaemon/210894 to your computer and use it in GitHub Desktop.
Save harukizaemon/210894 to your computer and use it in GitHub Desktop.
require 'rack'
module Rack
class Obama
CONTENT_TYPE = "nobel-prize/peace".freeze
def initialize(app)
@app = app
end
def call(env)
if env["CONTENT_TYPE"] == CONTENT_TYPE
["202 Accepted", {"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