Skip to content

Commit

Permalink
Merge pull request #1323 from microsoft/dev/se-fix
Browse files Browse the repository at this point in the history
Fix for badly formatted user agent JSON response to Streaming requests.
  • Loading branch information
DDEfromOR authored Oct 18, 2019
2 parents 951e179 + 998cea2 commit 0efce8d
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions libraries/botbuilder/src/botFrameworkAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ export class BotFrameworkAdapter extends BotAdapter implements IUserTokenProvide

if (request.verb.toLocaleUpperCase() === GET && request.path.toLocaleLowerCase() === VERSION_PATH) {
response.statusCode = StatusCodes.OK;
response.setBody(this.getUserAgent());
response.setBody({UserAgent: USER_AGENT});

return response;
}
Expand Down Expand Up @@ -1210,18 +1210,6 @@ export class BotFrameworkAdapter extends BotAdapter implements IUserTokenProvide
return Promise.reject(error);
}
}

private getUserAgent(): string {
if(USER_AGENT){
return USER_AGENT;
}
const ARCHITECTURE: any = os.arch();
const TYPE: any = os.type();
const RELEASE: any = os.release();
const NODE_VERSION: any = process.version;
return `Microsoft-BotFramework/3.1 BotBuilder/${ pjson.version } ` +
`(Node.js,Version=${ NODE_VERSION }; ${ TYPE } ${ RELEASE }; ${ ARCHITECTURE })`;
}
}

/**
Expand Down

0 comments on commit 0efce8d

Please sign in to comment.