Skip to content

Commit 231c948

Browse files
authored
Merge pull request #94 from watson-developer-cloud/fix_8132
fix: correct websocket function
2 parents a3a518e + c393092 commit 231c948

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

lib/ibm_watson/speech_to_text_v1.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,7 @@ def recognize_using_websocket(
568568
require_relative("./websocket/speech_to_text_websocket_listener.rb")
569569
headers = {}
570570
headers = conn.default_options.headers.to_hash unless conn.default_options.headers.to_hash.empty?
571+
@authenticator.authenticate(headers)
571572
service_url = @service_url.gsub("https:", "wss:")
572573
params = {
573574
"model" => model,

test/integration/test_speech_to_text_v1.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ def test_recognize_websocket_as_chunks
189189
end
190190
thr = Thread.new { speech.start }
191191
thr.join
192+
assert(atomic_boolean.false?)
192193
end
193194

194195
def test_recognize_websocket
@@ -206,6 +207,7 @@ def test_recognize_websocket
206207
)
207208
thr = Thread.new { speech.start }
208209
thr.join
210+
assert(atomic_boolean.false?)
209211
end
210212

211213
def test_inactivity_timeout_using_websocket

0 commit comments

Comments
 (0)