···7676 proxy_to upstream_url_for(request.path_info), :put
7777end
78787979+options /(.*)/ do
8080+ proxy_to upstream_url_for(request.path_info), :options
8181+end
8282+7983def proxy_to(url, method)
8484+ if RAW_QUERIES
8585+ puts "#{request.env["REQUEST_METHOD"]} request to #{request.path_info}:"
8686+ request.env.each do |k,v|
8787+ if k.match(/^[A-Z_]+$/)
8888+ puts " #{k}: #{v}"
8989+ end
9090+ end
9191+ end
9292+8093 puts "proxying #{method.to_s.upcase} to #{url}"
81948295 uri = URI.parse(url)
···121134 res = h.put(uri.path, post_data, send_headers)
122135 when :delete
123136 res = h.delete(uri.path, send_headers)
137137+ when :options
138138+ res = h.options(uri.path, send_headers)
124139 else
125140 raise "unknown method type #{method.inspect}"
126141 end