From db6c955905a3065d19e3957af5c3ad52043aa12e Mon Sep 17 00:00:00 2001 From: George Pollard Date: Thu, 1 Sep 2022 20:24:53 +0000 Subject: [PATCH] Allow extra properties iff they are null --- src/ApiService/ApiService/onefuzzlib/Request.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ApiService/ApiService/onefuzzlib/Request.cs b/src/ApiService/ApiService/onefuzzlib/Request.cs index a250a7f5945..39deafb1069 100644 --- a/src/ApiService/ApiService/onefuzzlib/Request.cs +++ b/src/ApiService/ApiService/onefuzzlib/Request.cs @@ -42,8 +42,12 @@ public static async Async.Task> ParseRequest(HttpRequestData // properties set: if (t.ExtensionData != null) { var errors = new List(); - foreach (var property in t.ExtensionData.Keys) { - errors.Add($"Unexpected property: \"{property}\""); + foreach (var (name, value) in t.ExtensionData) { + // allow additional properties if they are null, + // otherwise produce an error + if (value.ValueKind != JsonValueKind.Null) { + errors.Add($"Unexpected property: \"{name}\""); + } } return new Error(