protocol-http 0.61.0 → 0.62.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6d9c6ec1ad76ece9ce8c4224638dd9b6ca28396de3d987d66c11cc4bd67f1d1
4
- data.tar.gz: 6a1e7f875bcde396e3596278f0e99dbf3dceab1b0466c4e8ef36c483830eb71c
3
+ metadata.gz: 7eaa0d9299bfac4824085a779deb8e2764bc650765cda32fba75285e16e76841
4
+ data.tar.gz: 0e7c464e04570d7634ddd1aae9bc9a2d3757b76ca855779ab49abb045ebd7da4
5
5
  SHA512:
6
- metadata.gz: 1408f7ca40c1c8ee3ac9593eafabe57577d390e3fdf3c37ea0f7941bc5c746ddc2da2b490da7abf6b2bf4aca852c600aae4ac7637e2768ac591943df8c52370f
7
- data.tar.gz: ae69c4ddce77d7b259e8ff0998cd510bfeb9c7e5d32f1f28794200c07f89ed8197345174087980e7d902ea1b38b4fdb26fa6357b92d1ab9b29a91b073d6e2e68
6
+ metadata.gz: 1865071baeceac8961adb366ba4b9148ccb07b730794a3a094980ad8134eac9b22b3ff0a1cc31cda148f6cfcebddfb039651b4db3dc2481dc341f627aacdeea1
7
+ data.tar.gz: c09a5f5e8fbb8bad7f762c9140f87dcd304b980a907c97e648659579f6a9f6514dc4a52d09779512e5eab519b7e51165239443d225e7729b095109f9524e22ea
checksums.yaml.gz.sig CHANGED
Binary file
@@ -52,7 +52,7 @@ module Protocol
52
52
  # @parameter buffer [String] the buffer which will receive the data
53
53
  # @returns [String] a buffer containing the data
54
54
  def read(length = nil, buffer = nil)
55
- return "" if length == 0
55
+ return (buffer ? buffer.clear : String.new) if length == 0
56
56
 
57
57
  buffer ||= String.new.force_encoding(Encoding::BINARY)
58
58
 
@@ -9,10 +9,14 @@ module Protocol
9
9
  class Error < StandardError
10
10
  end
11
11
 
12
- # Raised when a request was not processed by the server and can be safely retried, even for non-idempotent methods.
13
- class RequestRefusedError < Error
12
+ # Raised when an HTTP stream or request was refused before any processing occurred.
13
+ # In the case of requests, it indicates that the request was refused before any processing occurred, and can be safely retried.
14
+ class RefusedError < Error
14
15
  end
15
16
 
17
+ # @deprecated Use {RefusedError} instead.
18
+ RequestRefusedError = RefusedError
19
+
16
20
  # Represents a bad request error (as opposed to a server error).
17
21
  # This is used to indicate that the request was malformed or invalid.
18
22
  module BadRequest
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Protocol
7
7
  module HTTP
8
- VERSION = "0.61.0"
8
+ VERSION = "0.62.1"
9
9
  end
10
10
  end
data/readme.md CHANGED
@@ -30,9 +30,13 @@ Please see the [project documentation](https://socketry.github.io/protocol-http/
30
30
 
31
31
  Please see the [project releases](https://socketry.github.io/protocol-http/releases/index) for all releases.
32
32
 
33
+ ### v0.62.1
34
+
35
+ - Fix handling of `Stream#read(0)`, it must return a mutable string (or clear the given buffer).
36
+
33
37
  ### v0.61.0
34
38
 
35
- - Introduce `Protocol::HTTP::RequestRefusedError` for indicating a request was not processed by the server and can be safely retried.
39
+ - Introduce `Protocol::HTTP::RefusedError` for indicating a stream or request was refused before processing and can be safely retried. `RequestRefusedError` is provided as an alias for backwards compatibility.
36
40
 
37
41
  ### v0.60.0
38
42
 
@@ -81,11 +85,6 @@ Please see the [project releases](https://socketry.github.io/protocol-http/relea
81
85
  - Introduce rich support for `Header::Digest`, `Header::ServerTiming`, `Header::TE`, `Header::Trailer` and `Header::TransferEncoding`.
82
86
  - [Improved HTTP Trailer Security](https://socketry.github.io/protocol-http/releases/index#improved-http-trailer-security)
83
87
 
84
- ### v0.53.0
85
-
86
- - Improve consistency of Body `#inspect`.
87
- - Improve `as_json` support for Body wrappers.
88
-
89
88
  ## See Also
90
89
 
91
90
  - [protocol-http1](https://github.com/socketry/protocol-http1) — HTTP/1 client/server implementation using this
data/releases.md CHANGED
@@ -1,8 +1,12 @@
1
1
  # Releases
2
2
 
3
+ ## v0.62.1
4
+
5
+ - Fix handling of `Stream#read(0)`, it must return a mutable string (or clear the given buffer).
6
+
3
7
  ## v0.61.0
4
8
 
5
- - Introduce `Protocol::HTTP::RequestRefusedError` for indicating a request was not processed by the server and can be safely retried.
9
+ - Introduce `Protocol::HTTP::RefusedError` for indicating a stream or request was refused before processing and can be safely retried. `RequestRefusedError` is provided as an alias for backwards compatibility.
6
10
 
7
11
  ## v0.60.0
8
12
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.61.0
4
+ version: 0.62.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file