From 4254b9c486067a60345d98f05b44c0b746f214b3 Mon Sep 17 00:00:00 2001 From: Oskar Eichler Date: Thu, 27 Aug 2026 23:12:09 +0300 Subject: [PATCH] Apply response settings to early final Expect responses --- lib/net/http.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/net/http.rb b/lib/net/http.rb index d1e9b2b..3a7345f 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -2501,8 +2501,6 @@ def transport_request(req) begin res = HTTPResponse.read_new(@socket) res.decode_content = req.decode_content - res.body_encoding = @response_body_encoding - res.ignore_eof = @ignore_eof if res.kind_of?(HTTPInformation) informational_count += 1 raise HTTPBadResponse, 'too many informational responses' if @@ -2510,10 +2508,11 @@ def transport_request(req) end end while res.kind_of?(HTTPInformation) - res.uri = req.uri - res } + res.body_encoding = @response_body_encoding + res.ignore_eof = @ignore_eof + res.uri = req.uri res.reading_body(@socket, req.response_body_permitted?) { if block_given? count = max_retries # Don't restart in the middle of a download