Skip to content

Commit 00b8b86

Browse files
committed
moved tenantid to header
1 parent 11362fd commit 00b8b86

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/wa/client/Client.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,8 @@ private void initialize(Properties props) {
10741074
String noSsl = props.getProperty("nossl", "false");
10751075
watsonSsl = noSsl.equalsIgnoreCase("false");
10761076
tenantID = props.getProperty("tenantID");
1077+
if (tenantID == null)
1078+
tenantID="";
10771079
userID = props.getProperty("userID");
10781080
watsonVoice = props.getProperty("voice");
10791081
commandSocketPort = Integer.parseInt(props.getProperty("cmdSocketPort", "10010"));
@@ -1230,9 +1232,12 @@ private synchronized void connect() throws InterruptedException {
12301232

12311233
try {
12321234
// Build request
1233-
String webSocketUrl = (watsonSsl ? "wss" : "ws") + "://" + watsonHost + (watsonPort == null ? "" : ":" + watsonPort) + "?skillset=" + skillset + "&tenantID=" + tenantID + "&userID=" + userID
1235+
String webSocketUrl = (watsonSsl ? "wss" : "ws") + "://" + watsonHost + (watsonPort == null ? "" : ":" + watsonPort) + "?skillset=" + skillset + "&userID=" + userID
12341236
+ "&language=" + language + "&engine=" + engine;
1235-
Request request = new Request.Builder().url(webSocketUrl).addHeader("Authorization", "Bearer " + iamAccessToken).build();
1237+
Request request = new Request.Builder().url(webSocketUrl)
1238+
.addHeader("Authorization", "Bearer " + iamAccessToken)
1239+
.addHeader("tenantid", tenantID)
1240+
.build();
12361241

12371242
// initialize the watch dog
12381243
Runnable cleanup = new CleanUp(this.audioInput, this.audioOutput, this.indicator);

0 commit comments

Comments
 (0)