Created
May 23, 2019 00:28
-
-
Save bsiegel/b4613b2788e78304cd4b966d7706201f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/sdk/servicebus/service-bus/src/connectionContext.ts b/sdk/servicebus/service-bus/src/connectionContext.ts | |
index 968a3e85..f81ebb12 100644 | |
--- a/sdk/servicebus/service-bus/src/connectionContext.ts | |
+++ b/sdk/servicebus/service-bus/src/connectionContext.ts | |
@@ -11,7 +11,8 @@ import { | |
CreateConnectionContextBaseParameters, | |
Dictionary, | |
delay, | |
- TokenProvider | |
+ TokenProvider, | |
+ isNode | |
} from "@azure/amqp-common"; | |
import { ServiceBusClientOptions } from "./serviceBusClient"; | |
import { ClientEntityContext } from "./clientEntityContext"; | |
@@ -39,9 +40,15 @@ export namespace ConnectionContext { | |
* @property {string} userAgent The user agent string for the ServiceBus client. | |
* See guideline at https://github.com/Azure/azure-sdk/blob/master/docs/design/Telemetry.mdk | |
*/ | |
- export const userAgent: string = `azsdk-js-azureservicebus/${ | |
- packageJsonInfo.version | |
- } (NODE-VERSION ${process.version}; ${os.type()} ${os.release()})`; | |
+ function getUAString(): string { | |
+ let uaString = `azsdk-js-azureservicebus/${packageJsonInfo.version}`; | |
+ if (isNode) { | |
+ uaString += ` (NODE - VERSION ${process.version}; ${os.type()} ${os.release()})`; | |
+ } | |
+ return uaString; | |
+ } | |
+ | |
+ export const userAgent: string = getUAString(); | |
export function create( | |
config: ConnectionConfig, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment