diff --git a/Design/Rule0043SecretText.cs b/Design/Rule0043SecretText.cs index 52a048be..104235a0 100644 --- a/Design/Rule0043SecretText.cs +++ b/Design/Rule0043SecretText.cs @@ -36,11 +36,7 @@ private void AnalyzeHttpObjects(OperationAnalysisContext ctx) { case MethodKind.BuiltInMethod: if (!buildInMethodNames.Contains(operation.TargetMethod.Name.ToLowerInvariant())) return; - - // We need to verify that the method is called from a HttpHeaders or HttpClient object - if (!ctx.Operation.DescendantsAndSelf().Where(x => x.GetSymbol() != null) - .Where(x => x.Type.GetNavTypeKindSafe() == NavTypeKind.HttpHeaders || x.Type.GetNavTypeKindSafe() == NavTypeKind.HttpClient) - .Any()) return; + if (!(operation.Instance?.GetSymbol().GetTypeSymbol().GetNavTypeKindSafe() == NavTypeKind.HttpHeaders || operation.Instance?.GetSymbol().GetTypeSymbol().GetNavTypeKindSafe() == NavTypeKind.HttpClient)) return; break; case MethodKind.Method: if (operation.TargetMethod.ContainingType.GetNavTypeKindSafe() != NavTypeKind.Codeunit) return;