--- http.rb.old Sun Jan 16 09:35:10 2011 +++ http.rb Tue Oct 18 14:16:35 2011 @@ -664,15 +664,16 @@ if use_ssl? begin if proxy? - @socket.writeline sprintf('CONNECT %s:%s HTTP/%s', + buf = sprintf("CONNECT %s:%s HTTP/%s\r\n", @address, @port, HTTPVersion) - @socket.writeline "Host: #{@address}:#{@port}" + buf << "Host: #{@address}:#{@port}\r\n" if proxy_user credential = ["#{proxy_user}:#{proxy_pass}"].pack('m') credential.delete!("\r\n") - @socket.writeline "Proxy-Authorization: Basic #{credential}" + buf << "Proxy-Authorization: Basic #{credential}\r\n" end - @socket.writeline '' + buf << "\r\n" + @socket.write(buf) HTTPResponse.read_new(@socket).value end timeout(@open_timeout) { s.connect }