Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@tryghost/admin-api

Package Overview
Dependencies
Maintainers
20
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tryghost/admin-api - npm Package Compare versions

Comparing version
1.12.2
to
1.13.0
+11
-2
lib/admin-api.js

@@ -44,2 +44,3 @@ /* eslint-disable no-restricted-syntax */

* @param {String|Boolean} options.version - a version string like v3.2, v4.1, v5.8 or boolean value identifying presence of Accept-Version header
* @param {String|Boolean} [options.userAgent] - flag controlling if the 'User-Agent' header should be sent with a request
* @param {Function} [options.makeRequest]

@@ -56,2 +57,3 @@ * @param {Function} [options.generateToken]

ghostPath: 'ghost',
userAgent: true,
generateToken: token,

@@ -431,6 +433,13 @@ makeRequest({url, method, data, params = {}, headers = {}}) {

const ghostHeaders = {
Authorization: authorizationHeader,
'User-Agent': `GhostAdminSDK/${packageVersion}`
Authorization: authorizationHeader
};
if (config.userAgent) {
if (typeof config.userAgent === 'boolean') {
ghostHeaders['User-Agent'] = `GhostAdminSDK/${packageVersion}`;
} else {
headers['User-Agent'] = config.userAgent;
}
}
if (config.acceptVersionHeader) {

@@ -437,0 +446,0 @@ ghostHeaders['Accept-Version'] = config.acceptVersionHeader;

+2
-2
{
"name": "@tryghost/admin-api",
"version": "1.12.2",
"version": "1.13.0",
"repository": "https://github.com/TryGhost/SDK/tree/master/packages/admin-api",

@@ -35,3 +35,3 @@ "author": "Ghost Foundation",

},
"gitHead": "ce790579ad1f191b24c05733d8a0a56f0b9f96d2"
"gitHead": "a1f560e288bf67886483f9b5d483eecd749c09cc"
}