Created
May 2, 2014 22:33
-
-
Save joho/0390c92fa369b0ebcf7d to your computer and use it in GitHub Desktop.
Fun little middleware I rediscovered in the Goodfilms codebase.
This file contains hidden or 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
class FuckXmlFoLife | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
if env["HTTP_ACCEPT"] == 'application/xml' | |
Rack::Response.new([], 406).finish | |
else | |
@app.call(env) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment