Node.js based forum software built for the modern web
fix: get version directly from package.json
Julian Lam3340720e3da7
diff --git a/src/request.js b/src/request.jsindex 52604ef77d..7f6efb300a 100644--- a/src/request.js+++ b/src/request.js@@ -1,17 +1,16 @@'use strict';-const nconf = require('nconf');const { CookieJar } = require('tough-cookie');const fetchCookie = require('fetch-cookie').default;+const { version } = require('../package.json');exports.jar = function () {return new CookieJar();};-// Initialize fetch - somewhat hacky, but it's required for globalDispatcher to be available--const userAgent = `NodeBB/${nconf.get('version').split('.').shift()}.x`;+const userAgent = `NodeBB/${version.split('.').shift()}.x`;+// Initialize fetch - somewhat hacky, but it's required for globalDispatcher to be availableasync function call(url, method, { body, timeout, jar, ...config } = {}) {let fetchImpl = fetch;if (jar) {