protocol-rack 0.2.6 → 0.3.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/protocol/rack/adapter/generic.rb +6 -1
- data/lib/protocol/rack/adapter/rack2.rb +0 -1
- data/lib/protocol/rack/constants.rb +1 -0
- data/lib/protocol/rack/input.rb +1 -1
- data/lib/protocol/rack/request.rb +2 -3
- data/lib/protocol/rack/version.rb +2 -2
- data/readme.md +8 -0
- data.tar.gz.sig +0 -0
- metadata +4 -88
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 698f8f014b44c23f6f975059abff65a0baa7c237c5e6e396fac1a3da3ad47a9d
|
4
|
+
data.tar.gz: b90f97e4ead49e5741505f08781f8684dc38ed9f3307aa94535cf734549a9aef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca48e4164ec6e0100add61bccdde2022d4eb7e3913481e8f688baab5799bbc2266a1188d9f0f1813af259ec88548f814e25e0ec4f0ef159421103365766857e2
|
7
|
+
data.tar.gz: b8e71d453c0ff35b2542c9483cd1fd0d17216934a4f4dda27d2ab6c2b516a65edfa7d7a9dcd00775cdbe4e85cbe16973ba380723e04c80734070ca8196136b82
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2022, by Samuel Williams.
|
4
|
+
# Copyright, 2022-2023, by Samuel Williams.
|
5
5
|
|
6
6
|
require 'console'
|
7
7
|
|
@@ -68,6 +68,11 @@ module Protocol
|
|
68
68
|
|
69
69
|
self.unwrap_headers(request.headers, env)
|
70
70
|
|
71
|
+
# For the sake of compatibility, we set the `HTTP_UPGRADE` header to the requested protocol.
|
72
|
+
if protocol = request.protocol and request.version.start_with?('HTTP/1')
|
73
|
+
env[CGI::HTTP_UPGRADE] = Array(protocol).join(",")
|
74
|
+
end
|
75
|
+
|
71
76
|
# HTTP/2 prefers `:authority` over `host`, so we do this for backwards compatibility.
|
72
77
|
env[CGI::HTTP_HOST] ||= request.authority
|
73
78
|
|
data/lib/protocol/rack/input.rb
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
require 'protocol/http/request'
|
7
7
|
require 'protocol/http/headers'
|
8
8
|
|
9
|
+
require_relative 'constants'
|
9
10
|
require_relative 'body/input_wrapper'
|
10
11
|
|
11
12
|
module Protocol
|
@@ -30,12 +31,10 @@ module Protocol
|
|
30
31
|
)
|
31
32
|
end
|
32
33
|
|
33
|
-
HTTP_UPGRADE = 'HTTP_UPGRADE'
|
34
|
-
|
35
34
|
def self.protocol(env)
|
36
35
|
if protocols = env['rack.protocol']
|
37
36
|
return Array(protocols)
|
38
|
-
elsif protocols = env[HTTP_UPGRADE]
|
37
|
+
elsif protocols = env[CGI::HTTP_UPGRADE]
|
39
38
|
return protocols.split(/\s*,\s*/)
|
40
39
|
end
|
41
40
|
end
|
data/readme.md
CHANGED
@@ -71,6 +71,14 @@ We welcome contributions to this project.
|
|
71
71
|
4. Push to the branch (`git push origin my-new-feature`).
|
72
72
|
5. Create new Pull Request.
|
73
73
|
|
74
|
+
### Developer Certificate of Origin
|
75
|
+
|
76
|
+
This project uses the [Developer Certificate of Origin](https://developercertificate.org/). All contributors to this project must agree to this document to have their contributions accepted.
|
77
|
+
|
78
|
+
### Contributor Covenant
|
79
|
+
|
80
|
+
This project is governed by [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
|
81
|
+
|
74
82
|
## See Also
|
75
83
|
|
76
84
|
- [protocol-http](https://github.com/socketry/protocol-http) — General abstractions for HTTP client/server implementations.
|
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.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -38,7 +38,7 @@ cert_chain:
|
|
38
38
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
39
39
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
40
40
|
-----END CERTIFICATE-----
|
41
|
-
date: 2023-
|
41
|
+
date: 2023-12-11 00:00:00.000000000 Z
|
42
42
|
dependencies:
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: protocol-http
|
@@ -68,90 +68,6 @@ dependencies:
|
|
68
68
|
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '1.0'
|
71
|
-
- !ruby/object:Gem::Dependency
|
72
|
-
name: async-http
|
73
|
-
requirement: !ruby/object:Gem::Requirement
|
74
|
-
requirements:
|
75
|
-
- - "~>"
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: '0.59'
|
78
|
-
type: :development
|
79
|
-
prerelease: false
|
80
|
-
version_requirements: !ruby/object:Gem::Requirement
|
81
|
-
requirements:
|
82
|
-
- - "~>"
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
version: '0.59'
|
85
|
-
- !ruby/object:Gem::Dependency
|
86
|
-
name: bake-test
|
87
|
-
requirement: !ruby/object:Gem::Requirement
|
88
|
-
requirements:
|
89
|
-
- - "~>"
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
version: '0.1'
|
92
|
-
type: :development
|
93
|
-
prerelease: false
|
94
|
-
version_requirements: !ruby/object:Gem::Requirement
|
95
|
-
requirements:
|
96
|
-
- - "~>"
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
version: '0.1'
|
99
|
-
- !ruby/object:Gem::Dependency
|
100
|
-
name: bake-test-external
|
101
|
-
requirement: !ruby/object:Gem::Requirement
|
102
|
-
requirements:
|
103
|
-
- - "~>"
|
104
|
-
- !ruby/object:Gem::Version
|
105
|
-
version: '0.1'
|
106
|
-
type: :development
|
107
|
-
prerelease: false
|
108
|
-
version_requirements: !ruby/object:Gem::Requirement
|
109
|
-
requirements:
|
110
|
-
- - "~>"
|
111
|
-
- !ruby/object:Gem::Version
|
112
|
-
version: '0.1'
|
113
|
-
- !ruby/object:Gem::Dependency
|
114
|
-
name: covered
|
115
|
-
requirement: !ruby/object:Gem::Requirement
|
116
|
-
requirements:
|
117
|
-
- - "~>"
|
118
|
-
- !ruby/object:Gem::Version
|
119
|
-
version: '0.16'
|
120
|
-
type: :development
|
121
|
-
prerelease: false
|
122
|
-
version_requirements: !ruby/object:Gem::Requirement
|
123
|
-
requirements:
|
124
|
-
- - "~>"
|
125
|
-
- !ruby/object:Gem::Version
|
126
|
-
version: '0.16'
|
127
|
-
- !ruby/object:Gem::Dependency
|
128
|
-
name: sus
|
129
|
-
requirement: !ruby/object:Gem::Requirement
|
130
|
-
requirements:
|
131
|
-
- - "~>"
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
version: '0.12'
|
134
|
-
type: :development
|
135
|
-
prerelease: false
|
136
|
-
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
requirements:
|
138
|
-
- - "~>"
|
139
|
-
- !ruby/object:Gem::Version
|
140
|
-
version: '0.12'
|
141
|
-
- !ruby/object:Gem::Dependency
|
142
|
-
name: sus-fixtures-async-http
|
143
|
-
requirement: !ruby/object:Gem::Requirement
|
144
|
-
requirements:
|
145
|
-
- - "~>"
|
146
|
-
- !ruby/object:Gem::Version
|
147
|
-
version: '0.1'
|
148
|
-
type: :development
|
149
|
-
prerelease: false
|
150
|
-
version_requirements: !ruby/object:Gem::Requirement
|
151
|
-
requirements:
|
152
|
-
- - "~>"
|
153
|
-
- !ruby/object:Gem::Version
|
154
|
-
version: '0.1'
|
155
71
|
description:
|
156
72
|
email:
|
157
73
|
executables: []
|
@@ -187,14 +103,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
187
103
|
requirements:
|
188
104
|
- - ">="
|
189
105
|
- !ruby/object:Gem::Version
|
190
|
-
version: '
|
106
|
+
version: '3.0'
|
191
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
192
108
|
requirements:
|
193
109
|
- - ">="
|
194
110
|
- !ruby/object:Gem::Version
|
195
111
|
version: '0'
|
196
112
|
requirements: []
|
197
|
-
rubygems_version: 3.4.
|
113
|
+
rubygems_version: 3.4.22
|
198
114
|
signing_key:
|
199
115
|
specification_version: 4
|
200
116
|
summary: An implementation of the Rack protocol/specification.
|
metadata.gz.sig
CHANGED
Binary file
|