lib/tap/mechanize/utils.rb in tap-mechanize-0.5.1 vs lib/tap/mechanize/utils.rb in tap-mechanize-0.6.0
- old
+ new
@@ -118,11 +118,11 @@
:headers => headers,
:params => params}
end
# Parses a Rack::Request, with the same activity as parse_http_request.
- def parse_rack_request(request, keep_content=true)
+ def parse_rack_request(request, request_params, keep_content=true)
headers = {}
request.env.each_pair do |key, value|
key = case key
when "HTTP_VERSION" then next
when /^HTTP_(.*)/ then $1
@@ -132,10 +132,10 @@
headers[headerize(key)] = value
end
params = {}
- request.params.each_pair do |key, value|
+ request_params.each_pair do |key, value|
params[key] = each_member(value) do |obj|
if obj.kind_of?(Hash)
file = {'Content-Type' => obj[:type], 'Filename' => obj[:filename]}
file['Content'] = obj[:tempfile].read if keep_content
file
\ No newline at end of file