Skip to content

BotFrameworkConfig.fromHost() should not set a SpeechServiceConnection_Host with a trailing slash #315

@compulim

Description

@compulim

Background

When calling BotFrameworkConfig.fromHost('xyz') or BotFrameworkConfig.fromHost(new URL('wss://xyz.convai.speech.azure.us')), the Web Socket connection established contains double-slash and the server is returning 404.

In network trace, the URL it is calling become (note the double-slash after the hostname):

wss://xyz.convai.speech.azure.us//api/v3?connectionid=...

The correct one should be the following, without double-slash.

wss://xyz.convai.speech.azure.us/api/v3?connectionid=...

Technical details

In /src/sdk/BotFrameworkConfig.ts:121, it set SpeechServiceConnection_Host with new URL('wss://xyz.convai.speech.azure.us').toString(). And it become wss://xyz.convai.speech.azure.us/. The trailing slash is added by URL.toString().

When running under Node.js 14, you can also see same behavior:

image

Then, when src/common.speech/DialogConnectorFactory.ts:70 construct the URL, it become double-slash.

When the code is run, the network trace I captured contains double-slash and the service is returning 404. Without the double-slash, the service operates normally.

image

image

Workaround

After calling BotFrameworkConfig.fromHost(), manually set the SpeechServiceConnection_Host property.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingin reviewAcknowledged and being looked at now

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions