Skip to content

Commit

Permalink
Minor change in userAgentDetails() function (#32372)
Browse files Browse the repository at this point in the history
### Packages impacted by this PR
@azure/cosmos

### Issues associated with this PR


### Describe the problem that is addressed by this PR


### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?


### Are there test cases added in this PR? _(If not, why?)_


### Provide a list of related PRs _(if any)_


### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
  • Loading branch information
ujjwalsoni1707 authored Dec 30, 2024
1 parent 02f964f commit 1ded535
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sdk/cosmosdb/cosmos/src/common/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ export function getUserAgent(suffix?: string): string {

// TODO: Standardize across other platforms from @azure/core-util
function userAgentDetails(): string {
let userAgentDetail = "<environment undetectable>";

if (globalThis.navigator && globalThis.navigator.userAgent) {
return globalThis.navigator.userAgent;
userAgentDetail = globalThis.navigator.userAgent;
}

if (globalThis.process && globalThis.process.version) {
return `Node.js/${process.version.slice(1)} (${process.platform}; ${process.arch})`;
userAgentDetail = `Node.js/${process.version.slice(1)} (${process.platform}; ${process.arch})`;
}

return "<environment undetectable>";
return userAgentDetail;
}

0 comments on commit 1ded535

Please sign in to comment.