async-websocket 0.28.0 → 0.29.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 888f2fa13744599f5f16f22feba6826ad1b8e44dc59520480daee4663cc89341
4
- data.tar.gz: f81c1f4d77d0593d6bfb59a5bd8c307ddaa218e5b22999f2f08ae5d5801e9dd4
3
+ metadata.gz: fe511fe780a41ad4b959d4cc7e34df333da5efb228c17c99387e1a27db14143a
4
+ data.tar.gz: f2839007377898a1dd9a1f1c5adda773c0d70e2f609291d8f31c6c75ea529311
5
5
  SHA512:
6
- metadata.gz: 6b71ab0e424b91f2e6500cc1277ac1edc7491f32144df6efc49847fbcdd200a9586b7be08d28341592862858cd4be6e7b1f5d31f983c6492b6667f4d543ec62c
7
- data.tar.gz: fb32ff7cc27011471594bf111dbbad00d4e458dc58664e916d426aea48fa808a33eb8e02304a31640d8179e0a21a09264b0811cacd8ac9c54e901b8055dec3c9
6
+ metadata.gz: 1bec34b54da82f76de3e9b8a5595621af25d9649af11d6b0faa5b5b2c284839be1e6923b5a53d7899b071a82ca35ad977227edae51089e32e73fed48a1fff38c
7
+ data.tar.gz: f3ed9911cf3bf886bfdf69d0c9bcb7f198ecc2eaea01879e65526165f72f36e52db7727359dd645a0af3056ed832961cca28f35f8cb24fea2f18a5026e1326c8
checksums.yaml.gz.sig CHANGED
Binary file
@@ -39,8 +39,9 @@ module Async
39
39
  connection = handler.call(framer, protocol, extensions)
40
40
 
41
41
  yield connection
42
-
43
- connection.close unless connection.closed?
42
+ ensure
43
+ connection&.close
44
+ stream.close
44
45
  end
45
46
 
46
47
  # Once we get to this point, we no longer need to hold on to the request:
@@ -62,9 +62,10 @@ module Async
62
62
 
63
63
  begin
64
64
  yield connection
65
+
65
66
  ensure
66
- connection.close
67
- client.close
67
+ connection&.close
68
+ client&.close
68
69
  end
69
70
  end
70
71
  end
@@ -19,6 +19,11 @@ module Async
19
19
  headers.add(SEC_WEBSOCKET_PROTOCOL, protocol)
20
20
  end
21
21
 
22
+ # For compatibility with HTTP/1 websockets proxied over HTTP/2, we process the accept nounce here:
23
+ if accept_nounce = request.headers[SEC_WEBSOCKET_KEY]&.first
24
+ headers.add(SEC_WEBSOCKET_ACCEPT, Nounce.accept_digest(accept_nounce))
25
+ end
26
+
22
27
  body = Async::HTTP::Body::Hijack.wrap(request, &block)
23
28
 
24
29
  super(request.version, 200, headers, body)
@@ -81,6 +81,7 @@ module Async
81
81
  raise ProtocolError, "Invalid accept digest, expected #{expected_accept_digest.inspect}, got #{accept_digest.inspect}!"
82
82
  end
83
83
  end
84
+
84
85
  verified = accept_digest && Array(response.protocol).map(&:downcase) == %w(websocket) && response.headers['connection']&.include?('upgrade')
85
86
 
86
87
  return Wrapper.new(response, verified: verified)
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module WebSocket
8
- VERSION = "0.28.0"
8
+ VERSION = "0.29.1"
9
9
  end
10
10
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-websocket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.0
4
+ version: 0.29.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -49,7 +49,7 @@ cert_chain:
49
49
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
50
50
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
51
51
  -----END CERTIFICATE-----
52
- date: 2024-07-19 00:00:00.000000000 Z
52
+ date: 2024-09-03 00:00:00.000000000 Z
53
53
  dependencies:
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: async-http
metadata.gz.sig CHANGED
Binary file