protocol-http 0.59.0 → 0.61.0

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: e36f456a67fc57a222502502affe651c8f27d5b92b3a08918acfc8e5a8d54a1f
4
- data.tar.gz: 465441e3c8c02f95c46a22147c4f7716d2db2927dd901ccb0b4f8aa00196741a
3
+ metadata.gz: e6d9c6ec1ad76ece9ce8c4224638dd9b6ca28396de3d987d66c11cc4bd67f1d1
4
+ data.tar.gz: 6a1e7f875bcde396e3596278f0e99dbf3dceab1b0466c4e8ef36c483830eb71c
5
5
  SHA512:
6
- metadata.gz: 887eff91a9b9ce7bbd7f7174029b34cb6b8039aa1dc4344d7eedc86dd398aec3bb81c16fd5d55d4e65b8175bba33baab785f2b8f4761a32d0c42be4c9d1eadf2
7
- data.tar.gz: b276d08be05079a3f00a87fc2fccbf1a7e517c9621424fa8de0678707a5c7eda6049db03f28a2ce335202d95282fe5748148bd9b9b6e36051d133997301fb92b
6
+ metadata.gz: 1408f7ca40c1c8ee3ac9593eafabe57577d390e3fdf3c37ea0f7941bc5c746ddc2da2b490da7abf6b2bf4aca852c600aae4ac7637e2768ac591943df8c52370f
7
+ data.tar.gz: ae69c4ddce77d7b259e8ff0998cd510bfeb9c7e5d32f1f28794200c07f89ed8197345174087980e7d902ea1b38b4fdb26fa6357b92d1ab9b29a91b073d6e2e68
checksums.yaml.gz.sig CHANGED
Binary file
data/context/headers.md CHANGED
@@ -63,8 +63,8 @@ HTTP trailers are headers that appear after the message body. For security reaso
63
63
  ```ruby
64
64
  # Working with trailers
65
65
  headers = Protocol::HTTP::Headers.new([
66
- ["content-type", "text/html"],
67
- ["content-length", "1000"]
66
+ ["content-type", "text/html"],
67
+ ["content-length", "1000"]
68
68
  ])
69
69
 
70
70
  # Start trailer section
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2025, by Samuel Williams.
4
+ # Copyright, 2019-2026, by Samuel Williams.
5
5
 
6
6
  require_relative "wrapper"
7
7
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2024-2025, by Samuel Williams.
4
+ # Copyright, 2024-2026, by Samuel Williams.
5
5
 
6
6
  require_relative "readable"
7
7
 
@@ -28,6 +28,9 @@ module Protocol
28
28
  # @attribute [Integer] The length of the response body if known.
29
29
  attr :length
30
30
 
31
+ # @attribute [Integer] The number of chunks written to the body.
32
+ attr :count
33
+
31
34
  # Stop generating output; cause the next call to write to fail with the given error. Does not prevent existing chunks from being read. In other words, this indicates both that no more data will be or should be written to the body.
32
35
  #
33
36
  # @parameter error [Exception] The error that caused this body to be closed, if any. Will be raised on the next call to {read}.
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2018-2025, by Samuel Williams.
4
+ # Copyright, 2018-2026, by Samuel Williams.
5
5
 
6
6
  module Protocol
7
7
  module HTTP
@@ -9,6 +9,10 @@ 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
14
+ end
15
+
12
16
  # Represents a bad request error (as opposed to a server error).
13
17
  # This is used to indicate that the request was malformed or invalid.
14
18
  module BadRequest
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2025, by Samuel Williams.
4
+ # Copyright, 2026, by Samuel Williams.
5
5
 
6
6
  require_relative "split"
7
7
 
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2018-2025, by Samuel Williams.
4
+ # Copyright, 2018-2026, by Samuel Williams.
5
5
 
6
6
  module Protocol
7
7
  module HTTP
8
- VERSION = "0.59.0"
8
+ VERSION = "0.61.0"
9
9
  end
10
10
  end
data/readme.md CHANGED
@@ -30,6 +30,14 @@ 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.61.0
34
+
35
+ - Introduce `Protocol::HTTP::RequestRefusedError` for indicating a request was not processed by the server and can be safely retried.
36
+
37
+ ### v0.60.0
38
+
39
+ - Expose `Protocol::HTTP::Body::Writable#count` attribute to provide access to the number of chunks written to the body.
40
+
33
41
  ### v0.59.0
34
42
 
35
43
  - Introduce `Protocol::HTTP::Middleware.load` method for loading middleware applications from files.
@@ -78,18 +86,6 @@ Please see the [project releases](https://socketry.github.io/protocol-http/relea
78
86
  - Improve consistency of Body `#inspect`.
79
87
  - Improve `as_json` support for Body wrappers.
80
88
 
81
- ### v0.52.0
82
-
83
- - Add `Protocol::HTTP::Headers#to_a` method that returns the fields array, providing compatibility with standard Ruby array conversion pattern.
84
- - Expose `tail` in `Headers.new` so that trailers can be accurately reproduced.
85
- - Add agent context.
86
-
87
- ### v0.51.0
88
-
89
- - `Protocol::HTTP::Headers` now raise a `DuplicateHeaderError` when a duplicate singleton header (e.g. `content-length`) is added.
90
- - `Protocol::HTTP::Headers#add` now coerces the value to a string when adding a header, ensuring consistent behaviour.
91
- - `Protocol::HTTP::Body::Head.for` now accepts an optional `length` parameter, allowing it to create a head body even when the body is not provided, based on the known content length.
92
-
93
89
  ## See Also
94
90
 
95
91
  - [protocol-http1](https://github.com/socketry/protocol-http1) — HTTP/1 client/server implementation using this
data/releases.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Releases
2
2
 
3
+ ## v0.61.0
4
+
5
+ - Introduce `Protocol::HTTP::RequestRefusedError` for indicating a request was not processed by the server and can be safely retried.
6
+
7
+ ## v0.60.0
8
+
9
+ - Expose `Protocol::HTTP::Body::Writable#count` attribute to provide access to the number of chunks written to the body.
10
+
3
11
  ## v0.59.0
4
12
 
5
13
  - Introduce `Protocol::HTTP::Middleware.load` method for loading middleware applications from files.
data.tar.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- @%6���=�=!'|4d��1���W9+hm�E�)�����D�F0y���=Qٮ��g�W���`hwZ͛��/r�,-� 2����g'_�x�G�i7����R�����$"ᖮ��Ul�qm�H���JT�>č'%��VH"!���������=����i�m��0��$8�f��N�r��e��n��sb�氾���� B��FF��a�a�[?�l���γz�t������}�s�sR?�*j���I&�L���l���b̃��s������V�<9J�L_7j�'�|r��ݺ��d0�0P��Ws�!ɱ�X����l�`�@��V��Y�G���؉I;{�d��,RP��G�
2
- Y�,���'ƿ
1
+ $�}��.������&�ǫ��^~�`�U��o'qe����PDN�\�kG#y��"Pw���|-�J)l�� 
2
+ >
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.59.0
4
+ version: 0.61.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -128,14 +128,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: '3.2'
131
+ version: '3.3'
132
132
  required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  requirements:
134
134
  - - ">="
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  requirements: []
138
- rubygems_version: 4.0.3
138
+ rubygems_version: 4.0.6
139
139
  specification_version: 4
140
140
  summary: Provides abstractions to handle HTTP protocols.
141
141
  test_files: []
metadata.gz.sig CHANGED
Binary file