lib/httpx/connection/http1.rb in httpx-0.15.4 vs lib/httpx/connection/http1.rb in httpx-0.16.0

- old
+ new

@@ -261,10 +261,12 @@ if !request.headers.key?("content-length") && request.body.bytesize == Float::INFINITY request.chunk! end - connection = if request.options.persistent + connection = request.headers["connection"] + + connection ||= if request.options.persistent # when in a persistent connection, the request can't be at # the edge of a renegotiation if @requests.index(request) + 1 < @max_requests "keep-alive" else