bugfix packageAgent

This commit is contained in:
AJ ONeal 2019-10-29 11:21:36 -06:00
parent 2a9b463964
commit 26adaf2037
1 changed files with 4 additions and 4 deletions

View File

@ -59,13 +59,13 @@ module.exports.create = function(opts) {
function addGreenlockAgent(opts) { function addGreenlockAgent(opts) {
// Add greenlock as part of Agent, unless this is greenlock // Add greenlock as part of Agent, unless this is greenlock
if (!/greenlock(-express|-pro)?/i.test(opts.packageAgent)) { var packageAgent = opts.packageAgent || "";
if (!/greenlock(-express|-pro)?/i.test(packageAgent)) {
var pkg = require("./package.json"); var pkg = require("./package.json");
var packageAgent = "Greenlock_Express/" + pkg.version; packageAgent += " Greenlock_Express/" + pkg.version;
opts.packageAgent += " " + packageAgent;
} }
return opts.packageAgent; return packageAgent.trim();
} }
// ex: John Doe <john@example.com> (https://john.doe) // ex: John Doe <john@example.com> (https://john.doe)