Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/azure-kusto-data/src/clientDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import { isNodeLike } from "@azure/core-util";
import { userInfo } from "os";
import { basename } from "path";
import { SDK_VERSION } from "./version.js";

// eslint-disable-next-line @typescript-eslint/no-namespace,@typescript-eslint/no-unused-vars -- This is the correct way to augment the global namespace
Expand Down Expand Up @@ -36,7 +37,9 @@ export class ClientDetails {

static defaultApplication(): string {
if (isNodeLike) {
return process?.env?.npm_package_name || process?.argv[1] || None;
// Use only the base filename from argv[1] to avoid leaking the full
// filesystem path (which may contain the username).
return process?.env?.npm_package_name || (process?.argv?.[1] ? basename(process.argv[1]) : None);
Comment on lines +40 to +42
} else {
return window?.location?.href || None;
}
Expand Down
Loading