Sanitize 400 error messages in GlobalExceptionHandler and validation filters to use static strings. This change improves consistency and prevents leaking internal exception details. Updated tests to reflect new error messages for JSON parsing and bad request scenarios.
ci/woodpecker/push/01-test Pipeline failed
ci/woodpecker/push/02-build-push unknown status

This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-06-25 19:02:25 +03:00
parent 7ed780b063
commit 01d7e7d584
12 changed files with 209 additions and 38 deletions
@@ -75,9 +75,9 @@ public sealed class UavTileUploadHandler : IUavTileUploadHandler
{
payload = JsonSerializer.Deserialize<UavTileBatchMetadataPayload>(metadataJson, MetadataJsonOptions);
}
catch (JsonException ex)
catch (JsonException)
{
return EnvelopeError($"Invalid `metadata` JSON: {ex.Message}");
return EnvelopeError("`metadata` could not be parsed as JSON.");
}
if (payload is null || payload.Items.Count == 0)