Skip to content

Instantly share code, notes, and snippets.

@ajsharp
Created January 6, 2012 03:28
Show Gist options
  • Select an option

  • Save ajsharp/1568799 to your computer and use it in GitHub Desktop.

Select an option

Save ajsharp/1568799 to your computer and use it in GitHub Desktop.
class SomeMiddleware
HOSTNAME = `hostname`.chomp.freeze
def initialize(app)
@app = app
end
def call(env)
if HOSTNAME == 'app1'
status, headers, body = @app.call(env)
[status, headers.merge('X-Special' => 'whatever'), body]
else
super
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment