isomorfeus-transport 2.0.8 → 2.0.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 623527e39fac566112b7017e4bdd35b99092896adab9da3a26196c6d11595e80
|
4
|
+
data.tar.gz: '00906d1188360fb9c5be7a3fa5136431441024542dd6e045083cbd0c364ab577'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7006b03f04333351df22525a2d6d15d244e42a5f4bc1f96b4c7ecfb85625fadbf1f25af8d7d30b2c71e34e0e6e61b5de0609521ea71696683bf0d963e6d23c1a
|
7
|
+
data.tar.gz: f75297a68b357c5b32da8276550f9436b24b5324d3ed170ad9e15b14f0890cb380fe1902eeb6ff232ee1b8cfe009db52a01318815d9ccf6bdba11f8655fc3c76
|
@@ -16,6 +16,7 @@ module Isomorfeus
|
|
16
16
|
cookie = cookies.detect { |c| c.start_with?('session=') }
|
17
17
|
if cookie
|
18
18
|
session_id = cookie[8..-1]
|
19
|
+
return [Anonymous.new, nil] if session_id.nil? || session_id.empty?
|
19
20
|
user = Isomorfeus.session_store.get_user(session_id: session_id)
|
20
21
|
[user, session_id]
|
21
22
|
end
|
@@ -11,10 +11,14 @@ module Isomorfeus
|
|
11
11
|
|
12
12
|
class SendError < StandardError; end
|
13
13
|
|
14
|
-
def initialize(url, protocols = nil)
|
14
|
+
def initialize(url, protocols = nil, headers = nil)
|
15
15
|
@url = url
|
16
|
-
@native_websocket = if protocols
|
16
|
+
@native_websocket = if protocols && headers
|
17
|
+
`new Opal.global.WebSocket(url, protocols, {headers: #{headers.to_n}})`
|
18
|
+
elsif protocols
|
17
19
|
`new Opal.global.WebSocket(url, protocols)`
|
20
|
+
elsif headers
|
21
|
+
`new Opal.global.WebSocket(url, {headers: #{headers.to_n}})`
|
18
22
|
else
|
19
23
|
`new Opal.global.WebSocket(url)`
|
20
24
|
end
|
data/lib/isomorfeus/transport.rb
CHANGED
@@ -11,7 +11,7 @@ module Isomorfeus
|
|
11
11
|
true
|
12
12
|
end
|
13
13
|
|
14
|
-
def promise_connect
|
14
|
+
def promise_connect(session_id = nil)
|
15
15
|
promise = Promise.new
|
16
16
|
if @socket && @socket.ready_state < 2
|
17
17
|
promise.resolve(true)
|
@@ -24,7 +24,8 @@ module Isomorfeus
|
|
24
24
|
else
|
25
25
|
ws_url = "#{Isomorfeus::TopLevel.transport_ws_url}"
|
26
26
|
end
|
27
|
-
|
27
|
+
headers = (session_id.nil? || session_id.empty?) ? nil : { 'Cookie': "session=#{session_id}" }
|
28
|
+
@socket = Isomorfeus::Transport::WebsocketClient.new(ws_url, nil, headers)
|
28
29
|
@socket.on_error do |error|
|
29
30
|
if Isomorfeus.on_browser?
|
30
31
|
`console.warn('Isomorfeus::Transport: Will try again, but so far error connecting:', error)`
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-transport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -114,28 +114,28 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 10.6.
|
117
|
+
version: 10.6.14
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 10.6.
|
124
|
+
version: 10.6.14
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: isomorfeus-policy
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - '='
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 2.0.
|
131
|
+
version: 2.0.9
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - '='
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 2.0.
|
138
|
+
version: 2.0.9
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: isomorfeus-redux
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,14 +170,14 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - '='
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 2.0.
|
173
|
+
version: 2.0.9
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - '='
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 2.0.
|
180
|
+
version: 2.0.9
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: rake
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|