lib/www/mechanize/chain/custom_headers.rb in mechanize-0.9.2 vs lib/www/mechanize/chain/custom_headers.rb in mechanize-0.9.3
- old
+ new
@@ -6,14 +6,14 @@
def handle(ctx, params)
request = params[:request]
params[:headers].each do |k,v|
case k
- when :etag then request.add_field("ETag", v)
- when :if_modified_since then request.add_field("If-Modified-Since", v)
+ when :etag then request["ETag"] = v
+ when :if_modified_since then request["If-Modified-Since"] = v
else
raise ArgumentError.new("unknown header symbol #{k}") if k.is_a? Symbol
- request.add_field(k,v)
+ request[k] = v
end
end
super
end
end