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 more useful details to the User-Agent header #190

Merged
merged 2 commits into from
Nov 10, 2016
Merged

Conversation

ewandennis
Copy link
Contributor

Adds a Node.js version string and an optional "stack identifier" so we can track libs that use node-sparkpost such as nodemailer-sparkpost-transport.

@aydrian aydrian self-assigned this Nov 8, 2016
@aydrian
Copy link
Contributor

aydrian commented Nov 8, 2016

Looks like just the documentation suggestion. And I'm guessing our reporting can handle the space separated values okay.

Copy link
Contributor

@aydrian aydrian left a comment

Choose a reason for hiding this comment

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

LGTM Thanks

createVersionStr = function(version, options) {
let versionStr = 'node-sparkpost/' + version + ' node.js/' + process.version;
if (options.stackIdentity) {
versionStr += options.stackIdentity + ' ' + versionStr;
Copy link
Contributor

Choose a reason for hiding this comment

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

If we are adding an option, it should be included somewhere in the docs.

@aydrian aydrian merged commit 02d0915 into master Nov 10, 2016
@aydrian aydrian deleted the stack-tracking branch November 10, 2016 15:15
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.

None yet

2 participants