protocol-rack 0.4.0 → 0.5.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/protocol/rack/adapter/generic.rb +9 -3
- data/lib/protocol/rack/adapter/rack2.rb +1 -4
- data/lib/protocol/rack/adapter/rack3.rb +4 -0
- data/lib/protocol/rack/adapter.rb +4 -0
- data/lib/protocol/rack/constants.rb +4 -0
- data/lib/protocol/rack/response.rb +1 -1
- 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: e9ac7ef853c3b25a46b06d630fc29921d76e8ee0213554d94afa19efdb9ccd87
|
4
|
+
data.tar.gz: ce65dd607e37ee33c6f20ecd4b0fa5976634be40869ac9d0add4e197d43d8cd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ea217d520678401acc7d89d5a592e958bc47bcffc07439c02f4f52e2df89c0cf0391e2f6fbb6c6a94be7e2f31a0b2757d2ccc389a7ae72311e3f7a30f388c47
|
7
|
+
data.tar.gz: a9e4587094746830e41a449892bc19c9fb43c7d5625529f321f8e5e72e0422908703719b0bdd983f96ea18f1a13f6697dbd06e254aa62e554cabf3356d97ba61
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -17,6 +17,11 @@ module Protocol
|
|
17
17
|
self.new(app)
|
18
18
|
end
|
19
19
|
|
20
|
+
def self.parse_file(...)
|
21
|
+
# This is the old interface, which was changed in Rack 3.
|
22
|
+
::Rack::Builder.parse_file(...).first
|
23
|
+
end
|
24
|
+
|
20
25
|
# Initialize the rack adaptor middleware.
|
21
26
|
# @parameter app [Object] The rack middleware.
|
22
27
|
def initialize(app)
|
@@ -26,9 +31,9 @@ module Protocol
|
|
26
31
|
end
|
27
32
|
|
28
33
|
def logger
|
29
|
-
Console
|
34
|
+
Console
|
30
35
|
end
|
31
|
-
|
36
|
+
|
32
37
|
# Unwrap raw HTTP headers into the CGI-style expected by Rack middleware.
|
33
38
|
#
|
34
39
|
# Rack separates multiple headers with the same key, into a single field with multiple lines.
|
@@ -74,6 +79,7 @@ module Protocol
|
|
74
79
|
end
|
75
80
|
|
76
81
|
if request.respond_to?(:hijack?) and request.hijack?
|
82
|
+
env[RACK_IS_HIJACK] = true
|
77
83
|
env[RACK_HIJACK] = proc{request.hijack!.io.dup}
|
78
84
|
end
|
79
85
|
|
@@ -115,7 +121,7 @@ module Protocol
|
|
115
121
|
|
116
122
|
return Response.wrap(env, status, headers, meta, body, request)
|
117
123
|
rescue => exception
|
118
|
-
Console.
|
124
|
+
Console.error(self, exception)
|
119
125
|
|
120
126
|
body&.close if body.respond_to?(:close)
|
121
127
|
|
@@ -17,9 +17,6 @@ module Protocol
|
|
17
17
|
RACK_MULTIPROCESS = 'rack.multiprocess'
|
18
18
|
RACK_RUN_ONCE = 'rack.run_once'
|
19
19
|
|
20
|
-
RACK_IS_HIJACK = 'rack.hijack?'
|
21
|
-
RACK_HIJACK = 'rack.hijack'
|
22
|
-
|
23
20
|
def self.wrap(app)
|
24
21
|
Rewindable.new(self.new(app))
|
25
22
|
end
|
@@ -90,7 +87,7 @@ module Protocol
|
|
90
87
|
|
91
88
|
return Response.wrap(env, status, headers, meta, body, request)
|
92
89
|
rescue => exception
|
93
|
-
Console.
|
90
|
+
Console.error(self, exception)
|
94
91
|
|
95
92
|
body&.close if body.respond_to?(:close)
|
96
93
|
|
@@ -15,6 +15,10 @@ module Protocol
|
|
15
15
|
self.new(app)
|
16
16
|
end
|
17
17
|
|
18
|
+
def self.parse_file(...)
|
19
|
+
::Rack::Builder.parse_file(...)
|
20
|
+
end
|
21
|
+
|
18
22
|
def make_environment(request)
|
19
23
|
request_path, query_string = request.path.split('?', 2)
|
20
24
|
server_name, server_port = (request.authority || '').split(':', 2)
|
@@ -43,7 +43,7 @@ module Protocol
|
|
43
43
|
ignored = headers.extract(HOP_HEADERS)
|
44
44
|
|
45
45
|
unless ignored.empty?
|
46
|
-
Console.
|
46
|
+
Console.warn(self, "Ignoring hop headers!", ignored: ignored)
|
47
47
|
end
|
48
48
|
|
49
49
|
if hijack_body = meta['rack.hijack']
|
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.5.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:
|
41
|
+
date: 2024-04-03 00:00:00.000000000 Z
|
42
42
|
dependencies:
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: protocol-http
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
112
|
requirements: []
|
113
|
-
rubygems_version: 3.
|
113
|
+
rubygems_version: 3.5.3
|
114
114
|
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: An implementation of the Rack protocol/specification.
|
metadata.gz.sig
CHANGED
Binary file
|