From 7850bf8f0895ccaa44818f2a7ad7e4d520010e15 Mon Sep 17 00:00:00 2001 From: Adam Chance <6444703+drakon64@users.noreply.github.com> Date: Tue, 24 Dec 2024 16:47:24 +0000 Subject: [PATCH] Store headers in a read-only dictionary --- .../Models/GoogleCloud/Tasks/CloudTaskHttpRequest.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Ktisis.Common/Models/GoogleCloud/Tasks/CloudTaskHttpRequest.cs b/Ktisis.Common/Models/GoogleCloud/Tasks/CloudTaskHttpRequest.cs index 0e49443..ac0de3b 100644 --- a/Ktisis.Common/Models/GoogleCloud/Tasks/CloudTaskHttpRequest.cs +++ b/Ktisis.Common/Models/GoogleCloud/Tasks/CloudTaskHttpRequest.cs @@ -1,12 +1,14 @@ +using System.Collections.ObjectModel; + namespace Ktisis.Common.Models.GoogleCloud.Tasks; public class CloudTaskHttpRequest { public required string Url { get; init; } public readonly string HttpMethod = "POST"; - public readonly Dictionary Headers = new() + public readonly ReadOnlyDictionary Headers = new Dictionary { { "Content-Type", "application/json" }, - }; + }.AsReadOnly(); public required string Body { get; init; } }