From 3a10d7bf08cde360a563c8bc412234cd2bf1dc9f Mon Sep 17 00:00:00 2001 From: Martin Othamar Date: Thu, 28 Nov 2024 12:27:59 +0100 Subject: [PATCH] Update checks --- src/Controllers/Storage/ProcessController.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Controllers/Storage/ProcessController.cs b/src/Controllers/Storage/ProcessController.cs index a778d50..7bb08e6 100644 --- a/src/Controllers/Storage/ProcessController.cs +++ b/src/Controllers/Storage/ProcessController.cs @@ -128,7 +128,11 @@ public async Task> PutInstanceAndEvents( { if (string.IsNullOrWhiteSpace(instanceEvent.InstanceId)) { - return BadRequest("Missing parameter values: instance event must exist and instanceId must be set"); + return BadRequest("Missing instance ID in InstanceEvent"); + } + else if (instanceEvent.InstanceId != $"{instanceOwnerPartyId}/{instanceGuid}") + { + return BadRequest("Instance ID in InstanceEvent does not match the Instance ID"); } instanceEvent.Created = instanceEvent.Created?.ToUniversalTime() ?? DateTime.UtcNow;