mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 00:56:13 +01:00
feat: #13066, report canonical URL in user agent for outgoing requests
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const nconf = require('nconf');
|
||||||
const { CookieJar } = require('tough-cookie');
|
const { CookieJar } = require('tough-cookie');
|
||||||
const fetchCookie = require('fetch-cookie').default;
|
const fetchCookie = require('fetch-cookie').default;
|
||||||
const { version } = require('../package.json');
|
const { version } = require('../package.json');
|
||||||
@@ -8,7 +9,7 @@ exports.jar = function () {
|
|||||||
return new CookieJar();
|
return new CookieJar();
|
||||||
};
|
};
|
||||||
|
|
||||||
const userAgent = `NodeBB/${version.split('.').shift()}.x`;
|
const userAgent = `NodeBB/${version.split('.').shift()}.x (${nconf.get('url')})`;
|
||||||
|
|
||||||
// Initialize fetch - somewhat hacky, but it's required for globalDispatcher to be available
|
// Initialize fetch - somewhat hacky, but it's required for globalDispatcher to be available
|
||||||
async function call(url, method, { body, timeout, jar, ...config } = {}) {
|
async function call(url, method, { body, timeout, jar, ...config } = {}) {
|
||||||
|
|||||||
Reference in New Issue
Block a user