add api user agent customization

This commit is contained in:
ghost 2023-09-15 23:24:59 +03:00
parent 11c397b566
commit 034a8c540a
4 changed files with 13 additions and 9 deletions

View file

@ -47,7 +47,6 @@ try
// Manifest
$manifest =
[
'version' => API_VERSION,
'updated' => time(),
'settings' => (object)
@ -109,6 +108,9 @@ try
'MAGNET_STOP_WORDS_SIMILAR' => (object) MAGNET_STOP_WORDS_SIMILAR,
'API_VERSION' => (string) API_VERSION,
'API_USER_AGENT' => (string) API_USER_AGENT,
'API_EXPORT_ENABLED' => (bool) API_EXPORT_ENABLED,
'API_EXPORT_PUSH_ENABLED' => (bool) API_EXPORT_PUSH_ENABLED,
'API_EXPORT_USERS_ENABLED' => (bool) API_EXPORT_USERS_ENABLED,

View file

@ -339,7 +339,7 @@ if (API_EXPORT_PUSH_ENABLED)
// Send push request
$debug['result'][$manifest->import->push]['request'] = $request;
$curl = new Curl($manifest->import->push, $request);
$curl = new Curl($manifest->import->push, API_USER_AGENT, $request);
if ($response = $curl->getResponse())
{