protocol-rack 0.4.1 → 0.5.1
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 +9 -4
- data/lib/protocol/rack/adapter/rack2.rb +2 -2
- data/lib/protocol/rack/adapter/rack3.rb +5 -1
- data/lib/protocol/rack/adapter.rb +5 -1
- data/lib/protocol/rack/constants.rb +1 -1
- data/lib/protocol/rack/input.rb +1 -2
- data/lib/protocol/rack/response.rb +2 -2
- data/lib/protocol/rack/version.rb +2 -2
- data/license.md +1 -1
- data/readme.md +1 -1
- data.tar.gz.sig +0 -0
- metadata +7 -5
- 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: f8eef2db46dd32a4307561b5d6d05b5b3874971473f0a01f669122bba02aa2f4
|
4
|
+
data.tar.gz: 24f7ce0dec015114a5d6a984ef3b3075446fee220975b1a9060100588124d262
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aaf3f413e3667955841c43dfbd66d0ed930bf0454a9fda0740af3d24ee2cab7055fa3dbe4807f4aa4d7684747e96567216eb9490a412ed68bc6c2a94c125fe60
|
7
|
+
data.tar.gz: b8055752788740184967b2ab59a9c9c612659451797aadadc956358b661e876afe7e8465dfc2ae72e5f4d27be27514a5a70ad76cd726460036ef1c41bc986d58
|
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-
|
4
|
+
# Copyright, 2022-2024, by Samuel Williams.
|
5
5
|
|
6
6
|
require 'console'
|
7
7
|
|
@@ -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.
|
@@ -116,7 +121,7 @@ module Protocol
|
|
116
121
|
|
117
122
|
return Response.wrap(env, status, headers, meta, body, request)
|
118
123
|
rescue => exception
|
119
|
-
Console.
|
124
|
+
Console.error(self, exception)
|
120
125
|
|
121
126
|
body&.close if body.respond_to?(:close)
|
122
127
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2022-
|
4
|
+
# Copyright, 2022-2024, by Samuel Williams.
|
5
5
|
|
6
6
|
require 'console'
|
7
7
|
|
@@ -87,7 +87,7 @@ module Protocol
|
|
87
87
|
|
88
88
|
return Response.wrap(env, status, headers, meta, body, request)
|
89
89
|
rescue => exception
|
90
|
-
Console.
|
90
|
+
Console.error(self, exception)
|
91
91
|
|
92
92
|
body&.close if body.respond_to?(:close)
|
93
93
|
|
@@ -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-2024, by Samuel Williams.
|
5
5
|
|
6
6
|
require 'console'
|
7
7
|
|
@@ -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)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2022-
|
4
|
+
# Copyright, 2022-2024, by Samuel Williams.
|
5
5
|
|
6
6
|
require 'rack'
|
7
7
|
|
@@ -24,6 +24,10 @@ module Protocol
|
|
24
24
|
def self.make_response(env, response)
|
25
25
|
IMPLEMENTATION.make_response(env, response)
|
26
26
|
end
|
27
|
+
|
28
|
+
def self.parse_file(...)
|
29
|
+
IMPLEMENTATION.parse_file(...)
|
30
|
+
end
|
27
31
|
end
|
28
32
|
end
|
29
33
|
end
|
data/lib/protocol/rack/input.rb
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2022-
|
4
|
+
# Copyright, 2022-2024, by Samuel Williams.
|
5
5
|
# Copyright, 2023, by Genki Takiuchi.
|
6
6
|
|
7
|
-
require 'async/io/buffer'
|
8
7
|
require 'protocol/http/body/stream'
|
9
8
|
|
10
9
|
module Protocol
|
@@ -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-2024, by Samuel Williams.
|
5
5
|
|
6
6
|
require_relative 'body'
|
7
7
|
require_relative 'constants'
|
@@ -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/license.md
CHANGED
data/readme.md
CHANGED
@@ -77,7 +77,7 @@ This project uses the [Developer Certificate of Origin](https://developercertifi
|
|
77
77
|
|
78
78
|
### Contributor Covenant
|
79
79
|
|
80
|
-
This project is governed by [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
|
80
|
+
This project is governed by the [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
|
81
81
|
|
82
82
|
## See Also
|
83
83
|
|
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.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:
|
41
|
+
date: 2024-04-24 00:00:00.000000000 Z
|
42
42
|
dependencies:
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: protocol-http
|
@@ -94,7 +94,9 @@ files:
|
|
94
94
|
homepage: https://github.com/socketry/protocol-rack
|
95
95
|
licenses:
|
96
96
|
- MIT
|
97
|
-
metadata:
|
97
|
+
metadata:
|
98
|
+
documentation_uri: https://socketry.github.io/protocol-rack/
|
99
|
+
source_code_uri: https://github.com/socketry/protocol-rack.git
|
98
100
|
post_install_message:
|
99
101
|
rdoc_options: []
|
100
102
|
require_paths:
|
@@ -103,14 +105,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
103
105
|
requirements:
|
104
106
|
- - ">="
|
105
107
|
- !ruby/object:Gem::Version
|
106
|
-
version: '3.
|
108
|
+
version: '3.1'
|
107
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
110
|
requirements:
|
109
111
|
- - ">="
|
110
112
|
- !ruby/object:Gem::Version
|
111
113
|
version: '0'
|
112
114
|
requirements: []
|
113
|
-
rubygems_version: 3.
|
115
|
+
rubygems_version: 3.5.3
|
114
116
|
signing_key:
|
115
117
|
specification_version: 4
|
116
118
|
summary: An implementation of the Rack protocol/specification.
|
metadata.gz.sig
CHANGED
Binary file
|