mirror of
https://github.com/ruby/ruby.git
synced 2026-10-29 00:46:26 +08:00
(https://github.com/ruby/net-http/pull/348) The current implementation has a problem with the following case: ```ruby print("HTTP/1.1 200 OK\r\n") print("Content-Length: 5\r\n") print(" \t\r\n") print("X-After: value\r\n") print("\r\n") print("hello") ``` The `" \t\r\n"` line should be processed as obs-fold in RFC 9112: https://www.rfc-editor.org/rfc/rfc9112.html#section-5.2 > obs-fold = OWS CRLF RWS > ; obsolete line folding > > A user agent that receives an obs-fold in a response message that > is not within a "message/http" container MUST replace each received > obs-fold with one or more SP octets prior to interpreting the field > value. But it's processed as the header part end: Header: ```text HTTP/1.1 200 OK Content-Length: 5 ``` Body: ```text X-After: value hello ``` It must be processed as the following (whitespace only obs-fold is ignored): Header: ```text HTTP/1.1 200 OK Content-Length: 5 X-After: value ``` Body: ```text hello ``` https://github.com/ruby/net-http/commit/6e2bc82919