more audit work
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
// Description: Utility class for webhook testing operations
|
||||
// =============================================================================
|
||||
|
||||
using System.Globalization;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
@@ -357,6 +358,18 @@ public static class WebhookTestHelper
|
||||
|
||||
foreach (var part in jsonPath.Split('.'))
|
||||
{
|
||||
if (element.ValueKind == JsonValueKind.Array &&
|
||||
int.TryParse(part, NumberStyles.None, CultureInfo.InvariantCulture, out var index))
|
||||
{
|
||||
if (index < 0 || index >= element.GetArrayLength())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
element = element[index];
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!element.TryGetProperty(part, out element))
|
||||
{
|
||||
return null;
|
||||
@@ -411,6 +424,18 @@ public static class WebhookTestHelper
|
||||
var current = element;
|
||||
foreach (var part in path)
|
||||
{
|
||||
if (current.ValueKind == JsonValueKind.Array &&
|
||||
int.TryParse(part, NumberStyles.None, CultureInfo.InvariantCulture, out var index))
|
||||
{
|
||||
if (index < 0 || index >= current.GetArrayLength())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
current = current[index];
|
||||
continue;
|
||||
}
|
||||
|
||||
if (current.ValueKind != JsonValueKind.Object ||
|
||||
!current.TryGetProperty(part, out current))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user