Skip to content

Commit de385e2

Browse files
authored
Fix wss urls and session_id lost (#559)
1 parent 1cd3d76 commit de385e2

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.devcontainer/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/
1010
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
1111
# && apt-get -y install --no-install-recommends chromium
1212

13+
# Allow yarn key
14+
ENV YARNKEY=yarn-keyring.gpg
15+
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo gpg --dearmour -o /usr/share/keyrings/$YARNKEY && \
16+
echo "deb [signed-by=/usr/share/keyrings/$YARNKEY] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
17+
1318
# OS packages required to run the application
1419
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
1520
&& apt-get -y install --no-install-recommends \

lib/ferrum/client/web_socket.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def initialize(url, max_receive_size, logger)
1919
uri = URI.parse(@url)
2020
port = uri.port || DEFAULT_PORTS[uri.scheme]
2121

22-
if port == 443
22+
if port == 443 || url.scheme == "wss"
2323
tcp = TCPSocket.new(uri.host, port)
2424
ssl_context = OpenSSL::SSL::SSLContext.new
2525
@sock = OpenSSL::SSL::SSLSocket.new(tcp, ssl_context)

lib/ferrum/context.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ def add_target(params:, session_id: nil)
6161
new_target = Target.new(@client, session_id, params)
6262
# `put_if_absent` returns nil if added a new value or existing if there was one already
6363
target = @targets.put_if_absent(new_target.id, new_target) || new_target
64+
# on first iteration session_id may be null, then if session is present here we must set it to the target
65+
target.session_id = session_id if session_id
6466
@default_target ||= target
6567

6668
new_pending = Concurrent::IVar.new

0 commit comments

Comments
 (0)