protocol-rack 0.19.0 → 0.21.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: 5864594e5fdeb7192006dc95ccc3d448a0c9b953e331f2df4a9bacad898309d5
4
- data.tar.gz: 056de84f70c904d064de318a532ea46ae1568e6882568a7c965f767696d984d9
3
+ metadata.gz: e1d01285c37f91d697e015646a6ed3efecfe08c8db97d94c636e27cec44497be
4
+ data.tar.gz: 1f494626f6f7fb446dc23e37eadcc0e8fae493c2701dabc796d108342b8dba58
5
5
  SHA512:
6
- metadata.gz: 5567e929cdedd1a8bdc9595d1b25c36b918bda3fe107c8e36af47af5a9fa95f8aaa311de7454df88c3dfecc437dd45c55b3763465314225ffa1902958d03423c
7
- data.tar.gz: c34f91c5a27fdccf962fe1738b6aeb23022c83e4923c7190ecede735d78cf3bb6dd5a9a6757148ee5b17e1e5750f9e2751dc90905efb42255e88ed916966016c
6
+ metadata.gz: 7dc7cc8c0df3b688c30ee1b13a6e2178a84a0ea5bfc66e6e50af9b36c239224c94abe11237d2f5d6310df75eb08a56ff56787c39cb33aebd28c85808a6cadeea
7
+ data.tar.gz: c9865d6691c36ebc6d8c5d3614317256831b55718d6655f90cb0843c60bed0cc75e02c96dfdf6005c0637c3cd65c70368dbd69091df41d026e372c41cba38a4b
checksums.yaml.gz.sig CHANGED
@@ -1 +1 @@
1
- Y�w����d��ʀ%2��
1
+ � �b�7��h��������}jNWc�Ij�e�~X�Y����)d�V����n�5\���Χ�>�"_�W�����'����r�V�,Lgx��w��޻�]�:*�aN�� ��l���KuJf����GС �m���L`N�F�k@0�׋W,�!
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2022-2025, by Samuel Williams.
4
+ # Copyright, 2022-2026, by Samuel Williams.
5
5
 
6
6
  require "console"
7
7
 
@@ -76,7 +76,7 @@ module Protocol
76
76
  env[http_key] = "#{current_value},#{value}"
77
77
  end
78
78
  else
79
- env[http_key] = value
79
+ env[http_key] = value.to_s
80
80
  end
81
81
  end
82
82
  end
@@ -105,7 +105,8 @@ module Protocol
105
105
  env[CGI::CONTENT_LENGTH] = length.to_s
106
106
  end
107
107
 
108
- self.unwrap_headers(request.headers, env)
108
+ # We ignore trailers for the purpose of constructing the rack environment:
109
+ self.unwrap_headers(request.headers.header, env)
109
110
 
110
111
  # For the sake of compatibility, we set the `HTTP_UPGRADE` header to the requested protocol.
111
112
  if protocol = request.protocol and request.version.start_with?("HTTP/1")
@@ -89,7 +89,7 @@ module Protocol
89
89
  # No-op.
90
90
  end
91
91
 
92
- def sysread(size, buffer = nil)
92
+ def sysread(size, buffer)
93
93
  if @body
94
94
  # User's may forget to call #close...
95
95
  if chunk = @body.read
@@ -100,13 +100,8 @@ module Protocol
100
100
  @closed = true
101
101
  end
102
102
 
103
- if buffer
104
- # If a buffer is provided, we copy the chunk into it:
105
- buffer.replace(chunk)
106
- else
107
- # Otherwise we return the chunk directly:
108
- buffer = chunk
109
- end
103
+ # The buffer is always provided, and we replace its contents:
104
+ buffer.replace(chunk)
110
105
 
111
106
  return buffer
112
107
  else
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Protocol
7
7
  module Rack
8
- VERSION = "0.19.0"
8
+ VERSION = "0.21.0"
9
9
  end
10
10
  end
data/license.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright, 2022-2025, by Samuel Williams.
3
+ Copyright, 2022-2026, by Samuel Williams.
4
4
  Copyright, 2023, by Genki Takiuchi.
5
5
  Copyright, 2025, by Francisco Mejia.
6
6
 
data/readme.md CHANGED
@@ -21,6 +21,14 @@ Please see the [project documentation](https://socketry.github.io/protocol-rack/
21
21
 
22
22
  Please see the [project releases](https://socketry.github.io/protocol-rack/releases/index) for all releases.
23
23
 
24
+ ### v0.21.0
25
+
26
+ - For the purpose of constructing the rack request environment, trailers are ignored.
27
+
28
+ ### v0.20.0
29
+
30
+ - Convert header values into strings using `to_s` so that `Headers#each` can yield non-string values if necessary.
31
+
24
32
  ### v0.19.0
25
33
 
26
34
  - Use `Headers#add` instead of `Headers#[]=` in Rack3 and Rack31 adapters, which is the correct interface for appending headers.
@@ -56,10 +64,6 @@ Please see the [project releases](https://socketry.github.io/protocol-rack/relea
56
64
 
57
65
  - Ignore (and close) response bodies for status codes that don't allow them.
58
66
 
59
- ### v0.11.2
60
-
61
- - Stop setting `env["SERVER_PORT"]` to `nil` if not present.
62
-
63
67
  ## Contributing
64
68
 
65
69
  We welcome contributions to this project.
data/releases.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Releases
2
2
 
3
+ ## v0.21.0
4
+
5
+ - For the purpose of constructing the rack request environment, trailers are ignored.
6
+
7
+ ## v0.20.0
8
+
9
+ - Convert header values into strings using `to_s` so that `Headers#each` can yield non-string values if necessary.
10
+
3
11
  ## v0.19.0
4
12
 
5
13
  - Use `Headers#add` instead of `Headers#[]=` in Rack3 and Rack31 adapters, which is the correct interface for appending headers.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -60,14 +60,14 @@ dependencies:
60
60
  requirements:
61
61
  - - "~>"
62
62
  - !ruby/object:Gem::Version
63
- version: '0.43'
63
+ version: '0.58'
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - "~>"
69
69
  - !ruby/object:Gem::Version
70
- version: '0.43'
70
+ version: '0.58'
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: rack
73
73
  requirement: !ruby/object:Gem::Requirement
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  - !ruby/object:Gem::Version
129
129
  version: '0'
130
130
  requirements: []
131
- rubygems_version: 3.6.9
131
+ rubygems_version: 4.0.3
132
132
  specification_version: 4
133
133
  summary: An implementation of the Rack protocol/specification.
134
134
  test_files: []
metadata.gz.sig CHANGED
Binary file