From: duerst@...Date: 2016-11-04T21:23:23+00:00Subject: [ruby-core:77933] [Ruby trunk Bug#12890] Net::HTTP should treat unexpected 1XX responses as non-final.Issue #12890 has been updated by Martin D��rst.A testing endpoint is available at https://nghttp2.org/?103-eh (see https://lists.w3.org/Archives/Public/ietf-http-wg/2016OctDec/0408_html).----------------------------------------Bug #12890: Net::HTTP should treat unexpected 1XX responses as non-final.https://bugs.ruby-lang.org/issues/12890#change-61252* Author: Cory Benfield* Status: Open* Priority: Normal* Assignee:* ruby -v: ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin16]* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN----------------------------------------Long story shortNet::HTTP's client does not tolerate non-100 status codes from the 1XX block in a sensible manner: it treats them as final responses, rather than as provisional ones.Expected behaviourWhen Net::HTTP receives a 1XX status code that it does not recognise, it should either surface these to a user in such a way that allows the user to access the subsequent final response, or it should ignore them and only show the user the eventual final status code. This is required by RFC 7231 Section 6.2 (Informational 1xx), which reads:> A client MUST be able to parse one or more 1xx responses received prior to a final response, even if the client does not expect one. A user agent MAY ignore unexpected 1xx responses.Actual behaviourNet::HTTP treats the 1XX status code as final. It parses the header block as though it were a response in the 2XX or higher range. Net::HTTP rightly assumes that 1XX responses have no body, which means that it leaves the following 2XX response unconsumed in the socket buffer, which will hide critical data from the user.Steps to reproduceThe following Python "server" can demonstrate the issue:~~~ pythonimport socketimport timedocument = b'''