Skip to content

Commit

Permalink
Fix async http adapter warning
Browse files Browse the repository at this point in the history
Problem: when using async http adapter rspec outputs the following
warning
`lib/webmock/http_lib_adapters/async_http_client_adapter.rb:154: warning: instance variable @alpn_protocol not initialized`
Reason for that is: `@alpn_protocol` is never defined.

Solution: don't use `@alpn_protocol`
  • Loading branch information
bruno- committed Sep 8, 2020
1 parent 382d84c commit 3101bb6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/webmock/http_lib_adapters/async_http_client_adapter.rb
Expand Up @@ -151,7 +151,7 @@ def inspect
def create_connected_sockets
Async::IO::Socket.pair(Socket::AF_UNIX, Socket::SOCK_STREAM).tap do |sockets|
sockets.each do |socket|
socket.instance_variable_set :@alpn_protocol, @alpn_protocol
socket.instance_variable_set :@alpn_protocol, nil
socket.instance_eval do
def alpn_protocol
nil # means HTTP11 will be used for HTTPS
Expand Down

0 comments on commit 3101bb6

Please sign in to comment.