Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lib/net/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2501,19 +2501,18 @@ 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
informational_count > HTTPResponse::MAX_INFORMATIONAL_RESPONSES
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
Expand Down