protocol-http 0.58.0 → 0.58.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: 971bece5e113d3f945faf8b8ce44858e97f0e6282e3a264b6e6fca1e57c8e71c
4
- data.tar.gz: 8d1139a2022dbe96710d7e0286a5c30c2384e14fcba3e0907428361b25c3a703
3
+ metadata.gz: e755c82bfe5d9098e7fe898dfb19e6963e500ab9410d9c7d04e2b6eb18886689
4
+ data.tar.gz: 23717c1485024e2f324cc069f7684a924f864a9f57c2a6e62b7be72ba532db45
5
5
  SHA512:
6
- metadata.gz: 69d17f997389daf2332cacc0d5ac407897e2dc2a45c3e329f23dfc9b18f7075b425e10c43fff27ff1728f64e92a6843e3291be5103e9ee8c72d1f810c2603c01
7
- data.tar.gz: '09676f19f6b3bd4d6290b5dccd8f93d2c6409e82926fa74a9b21f39f4fa92df0d289ef8fac6b0460a9de2784d78d7114d262f9a5088f66518ef60b9d60a877f4'
6
+ metadata.gz: a70c2c04344069a17fe6cdf1a5d23dcdaffcfbbfad815937d229c8bdeb7299bef0db2eb45c37e0fec6c1ba8cdf729560ebfcbb261910d630fc2d15d89a7b46a9
7
+ data.tar.gz: fc047716362a83605223b9f0107a652ac8dcaa860c10815dd755c55a7ba73dc4a4ef468212d570e6c37340e6d7bfc3ba85ad6623c1620d38b2bbce57a9e3e4be
checksums.yaml.gz.sig CHANGED
Binary file
@@ -19,12 +19,30 @@ module Protocol
19
19
  include BadRequest
20
20
 
21
21
  # @parameter key [String] The header key that was duplicated.
22
- def initialize(key)
22
+ def initialize(key, existing_value, new_value)
23
23
  super("Duplicate singleton header key: #{key.inspect}")
24
+
25
+ @key = key
26
+ @existing_value = existing_value
27
+ @new_value = new_value
24
28
  end
25
29
 
26
30
  # @attribute [String] key The header key that was duplicated.
27
31
  attr :key
32
+
33
+ # @attribute [String] existing_value The existing value for the duplicated header.
34
+ attr :existing_value
35
+
36
+ # @attribute [String] new_value The new value for the duplicated header.
37
+ attr :new_value
38
+
39
+ def detailed_message(highlight: false)
40
+ <<~MESSAGE
41
+ #{self.message}
42
+ Existing value: #{@existing_value.inspect}
43
+ New value: #{@new_value.inspect}
44
+ MESSAGE
45
+ end
28
46
  end
29
47
 
30
48
  # Raised when an invalid trailer header is encountered in headers.
@@ -453,7 +453,7 @@ module Protocol
453
453
  end
454
454
  else
455
455
  if hash.key?(key)
456
- raise DuplicateHeaderError, key
456
+ raise DuplicateHeaderError.new(key, hash[key], value)
457
457
  end
458
458
 
459
459
  hash[key] = value
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Protocol
7
7
  module HTTP
8
- VERSION = "0.58.0"
8
+ VERSION = "0.58.1"
9
9
  end
10
10
  end
data/readme.md CHANGED
@@ -30,6 +30,10 @@ 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.58.1
34
+
35
+ - `Protocol::HTTP::DuplicateHeaderError` now includes the existing and new values for better debugging.
36
+
33
37
  ### v0.58.0
34
38
 
35
39
  - Move trailer validation to `Headers#add` method to ensure all additions are checked at the time of addition as this is a hard requirement.
@@ -85,10 +89,6 @@ Please see the [project releases](https://socketry.github.io/protocol-http/relea
85
89
 
86
90
  - Drop support for Ruby v3.1.
87
91
 
88
- ### v0.48.0
89
-
90
- - Add support for parsing `accept`, `accept-charset`, `accept-encoding` and `accept-language` headers into structured values.
91
-
92
92
  ## See Also
93
93
 
94
94
  - [protocol-http1](https://github.com/socketry/protocol-http1) — HTTP/1 client/server implementation using this
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v0.58.1
4
+
5
+ - `Protocol::HTTP::DuplicateHeaderError` now includes the existing and new values for better debugging.
6
+
3
7
  ## v0.58.0
4
8
 
5
9
  - Move trailer validation to `Headers#add` method to ensure all additions are checked at the time of addition as this is a hard requirement.
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.58.0
4
+ version: 0.58.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file