@binance/common 2.3.7 → 2.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -530,6 +530,9 @@ function replaceWebsocketStreamsPlaceholders(str, variables) {
|
|
|
530
530
|
* @returns {string} A formatted user agent string including package details, Node.js version, platform, and architecture.
|
|
531
531
|
*/
|
|
532
532
|
function buildUserAgent(packageName, packageVersion) {
|
|
533
|
+
const BINANCE_ENV_VAR_USER_AGENT_REGEX = /^binance-cli\/[A-Za-z0-9._-]+ \([^;()]+; [^;()]+; [^;()]+\)$/;
|
|
534
|
+
const overriddenUserAgent = process.env["BINANCE_CONNECTOR_JS_USER_AGENT"]?.trim();
|
|
535
|
+
if (overriddenUserAgent && BINANCE_ENV_VAR_USER_AGENT_REGEX.test(overriddenUserAgent)) return overriddenUserAgent;
|
|
533
536
|
return `${packageName}/${packageVersion} (Node.js/${process.version}; ${platform()}; ${arch()})`;
|
|
534
537
|
}
|
|
535
538
|
/**
|