collin (owner)

Revisions

gist: 148348 Download_button fork
public
Public Clone URL: git://gist.github.com/148348.git
Embed All Files: show embed
rack_proxy_pass.rb #
1
2
3
4
5
6
7
8
9
10
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