anycable-core 1.5.0 → 1.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51822ff8e8b07d8967dfaeed99b65c45e7cf8a2d3868f94f09dd81a26d934bd8
4
- data.tar.gz: d782bdda587a181716bd0d6dc0aa19d0a6c24b0236b0cb3aa3354100364839a8
3
+ metadata.gz: e580fb7244e7eb0d8ad4d749ec3eaec19e5490152c39c1f30f42b53249185536
4
+ data.tar.gz: 7da10692cea6e5d1d9ced38075c649077eed8ed5a5c49cdaac446cb7dbe686ff
5
5
  SHA512:
6
- metadata.gz: f2f48cae19656f6b3360f8173a76d91ec2e6bf87434c7b8ccc00e3fae5dd3f89542f8d545348944b2eee90068833cc74fbf33be929885eb0427c019f9a0c9ba1
7
- data.tar.gz: 00a17dedd9dd6f572aca18fe08f77d5d234c5b5636497f2b925b5dafbb230c4b918d4a4fa5a020d1adb612d9c11528554579e9ec81589b336081792249029a3d
6
+ metadata.gz: 196239a321ae0f634b2cbe61b81d83e454b3be116b0748ca80b07405ecc1e333258735b9195f7e6b927c30dc0677101805f0dbad267b15beb96b17ca20823b7a
7
+ data.tar.gz: 6430837a566150c68611488d82ccf1e0955953f1ef4ecf32df3b00ace5c255dc5755f051e4ee3fb3ab18d0c286e1e214ec759b6fc4fea6a698e34a51e80ad03c
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 1.5.1 (2024-06-14) 🇪🇺 ⚽️
6
+
7
+ - Fixed compatibility with Rack 3.1 ([@earlopain][])
8
+
5
9
  ## 1.5.0 (2024-04-01)
6
10
 
7
11
  - Fixed gRPC keepalive settings to align with the Go server client. ([@palkan][])
@@ -211,3 +215,4 @@ See [Changelog](https://github.com/anycable/anycable/blob/0-6-stable/CHANGELOG.m
211
215
  [@smasry]: https://github.com/smasry
212
216
  [@Envek]: https://github.com/Envek
213
217
  [@cylon-v]: https://github.com/cylon-v
218
+ [@earlopain]: https://github.com/earlopain
@@ -27,8 +27,9 @@ module AnyCable
27
27
  return [404, {}, ["Not found"]] unless AnyCable.rpc_handler.supported?(rpc_command)
28
28
 
29
29
  # read request body and it's empty, return 422
30
- request_body = env["rack.input"].read
31
- return [422, {}, ["Empty request body"]] if request_body.empty?
30
+ # rack.input is optional starting in Rack 3.1
31
+ request_body = env["rack.input"]&.read
32
+ return [422, {}, ["Empty request body"]] if request_body.nil? || request_body.empty?
32
33
 
33
34
  payload =
34
35
  case rpc_command
@@ -154,22 +154,30 @@ module AnyCable
154
154
  # (not all of them though, just those enough for Action Cable to work)
155
155
  # See https://rubydoc.info/github/rack/rack/master/file/SPEC
156
156
  # and https://github.com/rack/rack/blob/master/lib/rack/lint.rb
157
- {
157
+ env = {
158
158
  "REQUEST_METHOD" => "GET",
159
159
  "SCRIPT_NAME" => "",
160
160
  "PATH_INFO" => "/",
161
161
  "QUERY_STRING" => "",
162
162
  "SERVER_NAME" => "",
163
163
  "SERVER_PORT" => "80",
164
+ "SERVER_PROTOCOL" => "HTTP/1.1",
164
165
  "rack.url_scheme" => "http",
165
166
  "rack.input" => StringIO.new("", "r").tap { |io| io.set_encoding(Encoding::ASCII_8BIT) },
166
- "rack.version" => ::Rack::VERSION,
167
167
  "rack.errors" => StringIO.new("").tap { |io| io.set_encoding(Encoding::ASCII_8BIT) },
168
168
  "rack.multithread" => true,
169
169
  "rack.multiprocess" => false,
170
170
  "rack.run_once" => false,
171
171
  "rack.hijack?" => false
172
172
  }
173
+
174
+ # Rack 3.1 removes `Rack::VERSION`. rack.version is optional (deprecated) since Rack 3.0
175
+ if ::Rack::RELEASE < "3.0"
176
+ rversion = ::Rack::VERSION
177
+ # @type var rversion : String
178
+ env["rack.version"] = rversion
179
+ end
180
+ env
173
181
  end
174
182
 
175
183
  def build_headers(headers)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AnyCable
4
- VERSION = "1.5.0"
4
+ VERSION = "1.5.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anycable-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - palkan
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-01 00:00:00.000000000 Z
11
+ date: 2024-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: anyway_config
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '2.0'
103
+ version: '3.0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '2.0'
110
+ version: '3.0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -277,7 +277,7 @@ metadata:
277
277
  homepage_uri: https://anycable.io/
278
278
  source_code_uri: http://github.com/anycable/anycable
279
279
  funding_uri: https://github.com/sponsors/anycable
280
- post_install_message:
280
+ post_install_message:
281
281
  rdoc_options: []
282
282
  require_paths:
283
283
  - lib
@@ -292,8 +292,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
292
292
  - !ruby/object:Gem::Version
293
293
  version: '0'
294
294
  requirements: []
295
- rubygems_version: 3.4.20
296
- signing_key:
295
+ rubygems_version: 3.4.19
296
+ signing_key:
297
297
  specification_version: 4
298
298
  summary: AnyCable core RPC implementation
299
299
  test_files: []