lib/http/client.rb in http-0.8.3 vs lib/http/client.rb in http-0.8.4

- old
+ new

@@ -19,12 +19,10 @@ KEEP_ALIVE = "Keep-Alive".freeze CLOSE = "close".freeze HTTP_OR_HTTPS_RE = %r{^https?://}i - attr_reader :default_options - def initialize(default_options = {}) @default_options = HTTP::Options.new(default_options) @connection = nil @state = :clean end @@ -70,11 +68,14 @@ verify_connection!(req.uri) @state = :dirty @connection ||= HTTP::Connection.new(req, options) - @connection.send_request(req) - @connection.read_headers! + + unless @connection.failed_proxy_connect? + @connection.send_request(req) + @connection.read_headers! + end res = Response.new( @connection.status_code, @connection.http_version, @connection.headers,