Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Johtaylo/issue1410 #1643

Merged
merged 2 commits into from
Apr 9, 2019
Merged

Johtaylo/issue1410 #1643

merged 2 commits into from
Apr 9, 2019

Conversation

johnataylor
Copy link
Member

fixes #1410

This adds the UserAgent for the scenario where the client (specifically the BotFrameworkAdapter) has passed in a custom HttpClient.

Care needs to be take because the headers collection is not thread safe. The Adapter will be a singleton which is why this code is called from the constructor.

Ideally in the (dot net core) future we will be able to use IHttpClientFactory consistently.

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 53651

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 145 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.004%) to 76.13%

Files with Coverage Reduction New Missed Lines %
/libraries/Microsoft.Bot.Builder/BotFrameworkAdapter.cs 145 22.68%
Totals Coverage Status
Change from base Build 53546: 0.004%
Covered Lines: 4363
Relevant Lines: 5731

💛 - Coveralls

@cleemullins
Copy link
Contributor

No issues found in Microsoft.Bot.Builder.dll
No issues found in Microsoft.Bot.Builder.AI.Luis.dll
No issues found in Microsoft.Bot.Builder.AI.QnA.dll
No issues found in Microsoft.Bot.Builder.ApplicationInsights.dll
No issues found in Microsoft.Bot.Builder.Azure.dll
No issues found in Microsoft.Bot.Builder.Dialogs.dll
No issues found in Microsoft.Bot.Builder.TemplateManager.dll
No issues found in Microsoft.Bot.Configuration.dll
No issues found in Microsoft.Bot.Connector.dll
No issues found in Microsoft.Bot.Schema.dll

Copy link
Member

@EricDahlvang EricDahlvang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems legit to me. (When an HttpClient is passed in, we aren't adding the UserAgent headers ServiceClient adds by default, but it probably doesn't matter: https://github.com/Azure/azure-sdk-for-net/blob/master/src/SdkCommon/ClientRuntime/ClientRuntime/ServiceClient.cs#L575 )

Thanks for fixing this John!

@johnataylor johnataylor merged commit 49cf018 into master Apr 9, 2019
@johnataylor johnataylor deleted the johtaylo/issue1410 branch April 9, 2019 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ConnectorClient's HttpClient's DefaultRequestHeaders are empty
4 participants