You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2e5a214
Browse filesBrowse the repository at this point in the historyBrowse files
# - Otherwise, if the `content-length` is present, the body is read until the content length is reached.
1003
1005
# - Otherwise, if `remainder` is true, the body is read until the connection is closed.
1004
1006
#
1007
+
# Framing errors (e.g. `transfer-encoding` in an HTTP/1.0 message, or a request whose final transfer coding is not `chunked`) are rejected and mark the connection as non-persistent, since the remainder of the stream can no longer be delimited reliably.
1008
+
#
1005
1009
# @parameter headers [Hash] the headers of the message.
1006
-
# @parameter remainder [Boolean] whether to read the remainder of the body.
1010
+
# @parameter remainder [Boolean] whether to read the remainder of the body, i.e. the message is a response which may be delimited by closing the connection.
1011
+
# @parameter version [String | Nil] the HTTP version of the message, if known.
1007
1012
# @returns [Object] the body.
1008
-
defread_body(headers,remainder=false)
1013
+
# @raises [BadRequest] if the message framing is invalid.
1014
+
defread_body(headers,remainder=false,version=nil)
1009
1015
# 3. If a Transfer-Encoding header field is present and the chunked
1010
1016
# transfer coding (Section 4.1) is the final encoding, the message
1011
1017
# body length is determined by reading and decoding the chunked
1012
1018
# data until the transfer coding indicates the data is complete.
Copy file name to clipboardExpand all lines: releases.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Releases
2
2
3
+
## Unreleased
4
+
5
+
- Reject `transfer-encoding` in HTTP/1.0 messages and requests whose final transfer coding is not `chunked` with `BadRequest`, and mark the connection as non-persistent, as required by RFC 9112 for reliable message framing.
6
+
3
7
## v0.41.0
4
8
5
9
- Map remote socket failures to `Protocol::HTTP::RemoteError` and prevent connection reuse.
0 commit comments