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

Add user agent and custom header to every request #148

Merged
merged 5 commits into from
Jan 28, 2019
Merged

Conversation

a-b-r-o-w-n
Copy link
Contributor

@a-b-r-o-w-n a-b-r-o-w-n commented Jan 28, 2019

This adds directline to the user agent header when possible. Currently some browsers do not allow scripts to set this header, so we are adding a custom header x-ms-bot-agent as well.

This change will enable better telemetry about bot traffic.

Example user agent strings:

"User-Agent": "DirectLine/3.0 (directlinejs/0.11.0; webchat/4.2.1) (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36)",
"x-ms-bot-agent": "DirectLine/3.0 (directlinejs/0.11.0; webchat/4.2.1)"

src/directLine.ts Outdated Show resolved Hide resolved
src/directLine.ts Outdated Show resolved Hide resolved
src/directLine.ts Outdated Show resolved Hide resolved
src/directLine.ts Show resolved Hide resolved
This pull request was closed.
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.

2 participants