Skip to content

Add user agent and custom header to every request#148

Merged
a-b-r-o-w-n merged 5 commits intomasterfrom
add-user-agent
Jan 28, 2019
Merged

Add user agent and custom header to every request#148
a-b-r-o-w-n merged 5 commits intomasterfrom
add-user-agent

Conversation

@a-b-r-o-w-n
Copy link
Copy Markdown
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)"

Comment thread src/directLine.ts Outdated
Comment thread src/directLine.ts Outdated
Comment thread src/directLine.ts Outdated
Comment thread src/directLine.ts
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