Skip to content

Commit 2db573b

Browse files
fix(stt): fix wss urls
1 parent bb6e94d commit 2db573b

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Source/SpeechToTextV1/WebSockets/SpeechToTextSession.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import IBMSwiftSDKCore
3434
public class SpeechToTextSession {
3535

3636
/// The URL that shall be used to stream audio for transcription.
37-
public var websocketsURL = "https://api.us-south.speech-to-text.watson.cloud.ibm.com/v1/recognize" {
37+
public var websocketsURL = "wss://api.us-south.speech-to-text.watson.cloud.ibm.com/v1/recognize" {
3838
didSet {
3939
// serviceURL and tokenURL are both derivative of websocketsURL
4040
if websocketsURL.last == "/" {

Tests/SpeechToTextV1Tests/SpeechToTextUnitTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ class SpeechToTextUnitTests: XCTestCase {
4444

4545
// Trailing forward slash
4646
speechToTextSession.websocketsURL = "wss://api.us-south.speech-to-text.watson.cloud.ibm.com/v1/recognize/"
47-
XCTAssertEqual(speechToTextSession.serviceURL, "api.us-south.speech-to-text.watson.cloud.ibm.com")
47+
XCTAssertEqual(speechToTextSession.serviceURL, "https://api.us-south.speech-to-text.watson.cloud.ibm.com")
4848

4949
// http instead of https
5050
speechToTextSession.websocketsURL = "ws://api.us-south.speech-to-text.watson.cloud.ibm.com/v1/recognize"
51-
XCTAssertEqual(speechToTextSession.serviceURL, "api.us-south.speech-to-text.watson.cloud.ibm.com")
51+
XCTAssertEqual(speechToTextSession.serviceURL, "http://api.us-south.speech-to-text.watson.cloud.ibm.com")
5252

5353
// Different base URL
5454
speechToTextSession.websocketsURL = "wss://example.com/speech-to-text/api/v1/recognize/v1/recognize"

0 commit comments

Comments
 (0)