Skip to content

Instantly share code, notes, and snippets.

@collin
Created July 16, 2009 10:44
Show Gist options
  • Select an option

  • Save collin/148348 to your computer and use it in GitHub Desktop.

Select an option

Save collin/148348 to your computer and use it in GitHub Desktop.
class Rack::ProxyPass
def initialize src, target, &block
@src, @target, @block = src, target, (block || lambda {|echo|echo})
end
def call env
request = Rack::Request.new(env)
response = request.forward_to(request.fullpath.sub(@src, @target), &@block)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment