websocket-driver 0.8.0 → 0.8.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 +4 -4
- data/CHANGELOG.md +8 -0
- data/LICENSE.md +1 -1
- data/lib/websocket/driver/draft75.rb +1 -0
- data/lib/websocket/driver/hybi.rb +4 -0
- data/lib/websocket/http/headers.rb +7 -4
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 29e86447ce1bcb8a90f93a8d93b8a80322f3c36e655f9a1a4e32415eddaeb129
|
|
4
|
+
data.tar.gz: 07c2dccd9d940048a1be5f8459f2c0d3214762f4bdd28f2096406e4df7725184
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 105e1d610de90d7b934b88ce141b1aff0496afc22b2599b56d046304b09c9476a122e0eb04f8cddc5303d6f38204334ad2b36113c46d28fbbb486292870eb870
|
|
7
|
+
data.tar.gz: 63e4ab5cd1ffadd35797b0dd713b5a3da3e6eed3e8c3cf09b0ebff18d7e3c931c6ed2b45e992dc26cf77a96e5a8be349318bcafe51bd80498ae389dc8a0f9d9f
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
### 0.8.1 / 2026-06-04
|
|
2
|
+
|
|
3
|
+
- Close a draft-75/76 connection if a length header grows to exceed the
|
|
4
|
+
configured max length
|
|
5
|
+
- Fail the connection if a message is larger than the configured max length
|
|
6
|
+
after extension processing
|
|
7
|
+
- Limit the total HTTP request line and headers size to 32K
|
|
8
|
+
|
|
1
9
|
### 0.8.0 / 2025-05-25
|
|
2
10
|
|
|
3
11
|
- Emit binary message as a string with `Encoding::BINARY` instead of an array
|
data/LICENSE.md
CHANGED
|
@@ -400,6 +400,10 @@ module WebSocket
|
|
|
400
400
|
|
|
401
401
|
payload = message.data
|
|
402
402
|
|
|
403
|
+
if payload.bytesize > @max_length
|
|
404
|
+
return fail(:too_large, 'WebSocket frame length too large')
|
|
405
|
+
end
|
|
406
|
+
|
|
403
407
|
case message.opcode
|
|
404
408
|
when OPCODES[:text] then
|
|
405
409
|
payload = Driver.encode(payload, Encoding::UTF_8)
|
|
@@ -2,7 +2,7 @@ module WebSocket
|
|
|
2
2
|
module HTTP
|
|
3
3
|
|
|
4
4
|
module Headers
|
|
5
|
-
|
|
5
|
+
MAX_REQUEST_SIZE = 32768
|
|
6
6
|
CR = 0x0D
|
|
7
7
|
LF = 0x0A
|
|
8
8
|
|
|
@@ -38,6 +38,7 @@ module WebSocket
|
|
|
38
38
|
attr_reader :headers
|
|
39
39
|
|
|
40
40
|
def initialize
|
|
41
|
+
@size = 0
|
|
41
42
|
@buffer = []
|
|
42
43
|
@env = {}
|
|
43
44
|
@headers = {}
|
|
@@ -54,6 +55,9 @@ module WebSocket
|
|
|
54
55
|
|
|
55
56
|
def parse(chunk)
|
|
56
57
|
chunk.each_byte do |octet|
|
|
58
|
+
@size += 1
|
|
59
|
+
return error if @size > MAX_REQUEST_SIZE
|
|
60
|
+
|
|
57
61
|
if octet == LF and @stage < 2
|
|
58
62
|
@buffer.pop if @buffer.last == CR
|
|
59
63
|
if @buffer.empty?
|
|
@@ -71,9 +75,8 @@ module WebSocket
|
|
|
71
75
|
end
|
|
72
76
|
end
|
|
73
77
|
@buffer = []
|
|
74
|
-
|
|
75
|
-
@buffer << octet
|
|
76
|
-
error if @stage < 2 and @buffer.size > MAX_LINE_LENGTH
|
|
78
|
+
elsif @stage >= 0
|
|
79
|
+
@buffer << octet
|
|
77
80
|
end
|
|
78
81
|
end
|
|
79
82
|
@env['rack.input'] = StringIO.new(string_buffer)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: websocket-driver
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Coglan
|
|
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
147
147
|
- !ruby/object:Gem::Version
|
|
148
148
|
version: '0'
|
|
149
149
|
requirements: []
|
|
150
|
-
rubygems_version: 3.6.
|
|
150
|
+
rubygems_version: 3.6.9
|
|
151
151
|
specification_version: 4
|
|
152
152
|
summary: WebSocket protocol handler with pluggable I/O
|
|
153
153
|
test_files: []
|