diff options
-rw-r--r-- | lib/net/http.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb index 53093492c2..b6e5de0a54 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -811,15 +811,15 @@ module Net #:nodoc: if use_ssl? begin if proxy? - @socket.writeline sprintf('CONNECT %s:%s HTTP/%s', - @address, @port, HTTPVersion) - @socket.writeline "Host: #{@address}:#{@port}" + buf = "CONNECT #{@address}:#{@port} HTTP/#{HTTPVersion}\r\n" + 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 # Server Name Indication (SNI) RFC 3546 |