websocket-driver 0.7.4-java → 0.7.5-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/websocket/driver.rb +13 -13
- data/lib/websocket/driver/hybi.rb +1 -1
- 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: 6c493f42d0b99554f08c80a52b3e746933b7641b5e1ff1b4bfd80eeb7c47987b
|
4
|
+
data.tar.gz: 1f2cd918f620ded04e91eae7ab235554f42ce7cdde6712c174490f238fda14da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54ee4bbd62e64e87d5b42576a93ca11785b40aa64ad2cf8350f49ccd79c652bf57860e793234e742e7def2d7a4fb8039fcff1cafb7640721811083dd482099df
|
7
|
+
data.tar.gz: 807a05150676ded5470934212214839e23c9ea31674d6a765c85af98432a77a43306ceb2a0c0aa4354fc700f5ed92596a76eff9626e7fac40df11490d87cd0f8
|
data/CHANGELOG.md
CHANGED
data/lib/websocket/driver.rb
CHANGED
@@ -115,7 +115,7 @@ module WebSocket
|
|
115
115
|
end
|
116
116
|
|
117
117
|
def text(message)
|
118
|
-
message =
|
118
|
+
message = Driver.encode(message, Encoding::UTF_8)
|
119
119
|
frame(message, :text)
|
120
120
|
end
|
121
121
|
|
@@ -194,19 +194,19 @@ module WebSocket
|
|
194
194
|
end
|
195
195
|
end
|
196
196
|
|
197
|
-
def self.encode(
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
encoding ||= Encoding::BINARY
|
202
|
-
when String then
|
203
|
-
encoding ||= Encoding::UTF_8
|
197
|
+
def self.encode(data, encoding = nil)
|
198
|
+
if Array === data
|
199
|
+
encoding ||= Encoding::BINARY
|
200
|
+
return data.pack('C*').force_encoding(encoding)
|
204
201
|
end
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
202
|
+
|
203
|
+
encoding ||= Encoding::UTF_8
|
204
|
+
|
205
|
+
return data if data.encoding == encoding
|
206
|
+
return data.encode(encoding) unless data.encoding == Encoding::BINARY
|
207
|
+
|
208
|
+
data = data.dup if data.frozen?
|
209
|
+
data.force_encoding(encoding)
|
210
210
|
end
|
211
211
|
|
212
212
|
def self.validate_options(options, valid_keys)
|
@@ -164,7 +164,7 @@ module WebSocket
|
|
164
164
|
message.rsv1 = message.rsv2 = message.rsv3 = false
|
165
165
|
message.opcode = OPCODES[type || (String === buffer ? :text : :binary)]
|
166
166
|
|
167
|
-
payload = Driver.encode(buffer
|
167
|
+
payload = Driver.encode(buffer)
|
168
168
|
payload = [code, payload].pack('S>a*') if code
|
169
169
|
message.data = payload
|
170
170
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: websocket-driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.5
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- James Coglan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|