Skip to content

Commit ddc2531

Browse files
committed
Fix enum issue
1 parent 8368977 commit ddc2531

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

shared/AppInsightsCore/Tests/Unit/src/ai/ApplicationInsightsCore.Tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2658,7 +2658,7 @@ export class ApplicationInsightsCoreTests extends AITestClass {
26582658
name: "FieldRedaction: should not redact credentials or query strings when redactUrls and redactQueryParams are false",
26592659
test: () => {
26602660
let config = {
2661-
redactUrls: UrlRedactionOptions.false
2661+
redactUrls: UrlRedactionOptions.redactNone
26622662
} as IConfiguration;
26632663
const url = "https://user:password@example.com/path?sig=secret&color=blue&token=abc123";
26642664
const redactedLocation = fieldRedaction(url, config);

shared/AppInsightsCore/src/enums/ai/UrlRedactionOptions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ export const enum UrlRedactionOptions {
99
/**
1010
* The default value, will redact the username and password as well as the default set of query parameters
1111
*/
12-
true = 1,
12+
redactAll = 1,
1313

1414
/**
1515
* Does not redact username and password or any query parameters, the URL will be left as is. Note: this is not recommended as it may lead
1616
* to sensitive data being sent in clear text.
1717
*/
18-
false = 2,
18+
redactNone = 2,
1919

2020
/**
2121
* This will append any additional queryParams that the user has provided through redactQueryParams config to the default set i.e to

shared/AppInsightsCore/src/utils/EnvUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ export function fieldRedaction(input: string, config: IConfiguration): string {
548548
if (!input || !isString(input) || strIndexOf(input, " ") !== -1) {
549549
return input;
550550
}
551-
const isRedactionDisabled = config && (config.redactUrls === false || config.redactUrls === UrlRedactionOptions["false"]);
551+
const isRedactionDisabled = config && (config.redactUrls === false || config.redactUrls === UrlRedactionOptions.redactNone);
552552
if (isRedactionDisabled) {
553553
return input;
554554
}

0 commit comments

Comments
 (0)