Skip to content

Commit

Permalink
Add node version to user agent (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
strausr authored Oct 11, 2021
1 parent 479bc20 commit ef08c7a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib-es5/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ exports.CF_SHARED_CDN = "d3jpl91pxevbkh.cloudfront.net";
exports.OLD_AKAMAI_SHARED_CDN = "cloudinary-a.akamaihd.net";
exports.AKAMAI_SHARED_CDN = "res.cloudinary.com";
exports.SHARED_CDN = exports.AKAMAI_SHARED_CDN;
exports.USER_AGENT = `CloudinaryNodeJS/${exports.VERSION}`;
exports.USER_AGENT = `CloudinaryNodeJS/${exports.VERSION} (Node ${process.versions.node})`;

// Add platform information to the USER_AGENT header
// This is intended for platform information and not individual applications!
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ exports.CF_SHARED_CDN = "d3jpl91pxevbkh.cloudfront.net";
exports.OLD_AKAMAI_SHARED_CDN = "cloudinary-a.akamaihd.net";
exports.AKAMAI_SHARED_CDN = "res.cloudinary.com";
exports.SHARED_CDN = exports.AKAMAI_SHARED_CDN;
exports.USER_AGENT = `CloudinaryNodeJS/${exports.VERSION}`;
exports.USER_AGENT = `CloudinaryNodeJS/${exports.VERSION} (Node ${process.versions.node})`;

// Add platform information to the USER_AGENT header
// This is intended for platform information and not individual applications!
Expand Down
2 changes: 1 addition & 1 deletion test/unit/cloudinaryUtils/getUserAgent.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ describe("getUserAgent", function () {
});
it("should add a user platform to USER_AGENT", function () {
cloudinary.utils.userPlatform = "Spec/1.0 (Test)";
expect(cloudinary.utils.getUserAgent()).to.match(/Spec\/1.0 \(Test\) CloudinaryNodeJS\/[\d.]+/);
expect(cloudinary.utils.getUserAgent()).to.match(/Spec\/1.0 \(Test\) CloudinaryNodeJS\/[\d.]+ \(Node [\d.]+\)/);
});
});

0 comments on commit ef08c7a

Please sign in to comment.