lib/httpx/connection/http1.rb in httpx-0.17.0 vs lib/httpx/connection/http1.rb in httpx-0.18.0

- old
+ new

@@ -281,13 +281,13 @@ else # when it's not a persistent connection, it sets "Connection: close" always # on the last request of the possible batch (either allowed max requests, # or if smaller, the size of the batch itself) requests_limit = [@max_requests, @requests.size].min - if request != @requests[requests_limit - 1] - "keep-alive" - else + if request == @requests[requests_limit - 1] "close" + else + "keep-alive" end end extra_headers = { "connection" => connection } extra_headers["host"] = request.authority unless request.headers.key?("host")