protocol-rack 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/protocol/rack/adapter/generic.rb +19 -1
- data/lib/protocol/rack/adapter/rack2.rb +2 -4
- data/lib/protocol/rack/adapter/rack3.rb +2 -3
- data/lib/protocol/rack/constants.rb +2 -0
- data/lib/protocol/rack/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -3
- 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: 63abbb92ce268dc594b9464a931bb846808788db40a11a5c5aae81b64552eb30
|
4
|
+
data.tar.gz: bd369d97c603d06cce3088f6d2f785c12fb20c52cc038d31d860d107cabd301c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7058394c8f576c1cbff70179dcde738d6c31036c01ef264178056281dac28195e2dc19a14c21242b22c00f8db695fd73a8836c0125e9e60c4f37010ed537c15
|
7
|
+
data.tar.gz: 8c73f392e0bb354693eb2a5063f5add1d5feccf13d5155991870b9d216f59dad31ae4831b5825cd0a47871799b4433eedc36e64b01d6656cefe157eb519882d4
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -45,7 +45,11 @@ module Protocol
|
|
45
45
|
http_key = "HTTP_#{key.upcase.tr('-', '_')}"
|
46
46
|
|
47
47
|
if current_value = env[http_key]
|
48
|
-
|
48
|
+
if http_key == CGI::HTTP_COOKIE
|
49
|
+
env[http_key] = "#{current_value};#{value}"
|
50
|
+
else
|
51
|
+
env[http_key] = "#{current_value},#{value}"
|
52
|
+
end
|
49
53
|
else
|
50
54
|
env[http_key] = value
|
51
55
|
end
|
@@ -138,6 +142,20 @@ module Protocol
|
|
138
142
|
def failure_response(exception)
|
139
143
|
Protocol::HTTP::Response.for_exception(exception)
|
140
144
|
end
|
145
|
+
|
146
|
+
def self.extract_protocol(env, response, headers)
|
147
|
+
if protocol = response.protocol
|
148
|
+
# This is the newer mechanism for protocol upgrade:
|
149
|
+
if env['rack.protocol']
|
150
|
+
headers['rack.protocol'] = protocol
|
151
|
+
|
152
|
+
# Older mechanism for protocol upgrade:
|
153
|
+
elsif env[CGI::HTTP_UPGRADE]
|
154
|
+
headers['upgrade'] = protocol
|
155
|
+
headers['connection'] = 'upgrade'
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
141
159
|
end
|
142
160
|
end
|
143
161
|
end
|
@@ -11,7 +11,7 @@ require_relative '../rewindable'
|
|
11
11
|
module Protocol
|
12
12
|
module Rack
|
13
13
|
module Adapter
|
14
|
-
class Rack2
|
14
|
+
class Rack2 < Generic
|
15
15
|
RACK_VERSION = 'rack.version'
|
16
16
|
RACK_MULTITHREAD = 'rack.multithread'
|
17
17
|
RACK_MULTIPROCESS = 'rack.multiprocess'
|
@@ -121,9 +121,7 @@ module Protocol
|
|
121
121
|
# These interfaces should be largely compatible:
|
122
122
|
headers = response.headers.to_h
|
123
123
|
|
124
|
-
|
125
|
-
headers['rack.protocol'] = protocol
|
126
|
-
end
|
124
|
+
self.extract_protocol(env, response, headers)
|
127
125
|
|
128
126
|
if body = response.body and body.stream?
|
129
127
|
if env[RACK_IS_HIJACK]
|
@@ -92,9 +92,8 @@ module Protocol
|
|
92
92
|
def self.make_response(env, response)
|
93
93
|
# These interfaces should be largely compatible:
|
94
94
|
headers = response.headers.to_h
|
95
|
-
|
96
|
-
|
97
|
-
end
|
95
|
+
|
96
|
+
self.extract_protocol(env, response, headers)
|
98
97
|
|
99
98
|
if body = response.body and body.stream?
|
100
99
|
# Force streaming response:
|
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.6.0
|
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: 2024-
|
41
|
+
date: 2024-06-14 00:00:00.000000000 Z
|
42
42
|
dependencies:
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: protocol-http
|
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
112
|
- !ruby/object:Gem::Version
|
113
113
|
version: '0'
|
114
114
|
requirements: []
|
115
|
-
rubygems_version: 3.5.
|
115
|
+
rubygems_version: 3.5.9
|
116
116
|
signing_key:
|
117
117
|
specification_version: 4
|
118
118
|
summary: An implementation of the Rack protocol/specification.
|
metadata.gz.sig
CHANGED
Binary file
|