Skip to content

Commit ef08c7a

Browse files
authored
Add node version to user agent (#519)
1 parent 479bc20 commit ef08c7a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib-es5/utils/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ exports.CF_SHARED_CDN = "d3jpl91pxevbkh.cloudfront.net";
8080
exports.OLD_AKAMAI_SHARED_CDN = "cloudinary-a.akamaihd.net";
8181
exports.AKAMAI_SHARED_CDN = "res.cloudinary.com";
8282
exports.SHARED_CDN = exports.AKAMAI_SHARED_CDN;
83-
exports.USER_AGENT = `CloudinaryNodeJS/${exports.VERSION}`;
83+
exports.USER_AGENT = `CloudinaryNodeJS/${exports.VERSION} (Node ${process.versions.node})`;
8484

8585
// Add platform information to the USER_AGENT header
8686
// This is intended for platform information and not individual applications!

lib/utils/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ exports.CF_SHARED_CDN = "d3jpl91pxevbkh.cloudfront.net";
6666
exports.OLD_AKAMAI_SHARED_CDN = "cloudinary-a.akamaihd.net";
6767
exports.AKAMAI_SHARED_CDN = "res.cloudinary.com";
6868
exports.SHARED_CDN = exports.AKAMAI_SHARED_CDN;
69-
exports.USER_AGENT = `CloudinaryNodeJS/${exports.VERSION}`;
69+
exports.USER_AGENT = `CloudinaryNodeJS/${exports.VERSION} (Node ${process.versions.node})`;
7070

7171
// Add platform information to the USER_AGENT header
7272
// This is intended for platform information and not individual applications!

test/unit/cloudinaryUtils/getUserAgent.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ describe("getUserAgent", function () {
1212
});
1313
it("should add a user platform to USER_AGENT", function () {
1414
cloudinary.utils.userPlatform = "Spec/1.0 (Test)";
15-
expect(cloudinary.utils.getUserAgent()).to.match(/Spec\/1.0 \(Test\) CloudinaryNodeJS\/[\d.]+/);
15+
expect(cloudinary.utils.getUserAgent()).to.match(/Spec\/1.0 \(Test\) CloudinaryNodeJS\/[\d.]+ \(Node [\d.]+\)/);
1616
});
1717
});

0 commit comments

Comments
 (0)