Skip to content

Commit

Permalink
case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-koshchei committed Oct 18, 2024
1 parent 2252815 commit 899daa2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
options.SerializerOptions.TypeInfoResolverChain.Insert(0, AppJsonSerializerContext.Default);
options.SerializerOptions.PropertyNameCaseInsensitive = true;
});
AppJsonSerializerContext.Default.Options.PropertyNameCaseInsensitive = true;

// Logging, I don't want to have appsettings.json
builder.Logging.SetMinimumLevel(LogLevel.Information);
Expand Down Expand Up @@ -106,6 +107,8 @@ [FromServices] EmailSwitch email

app.Run();



bool IsAuthorized(string header)
{
var parts = header.Split(' ', StringSplitOptions.RemoveEmptyEntries);
Expand All @@ -115,6 +118,7 @@ bool IsAuthorized(string header)
return key == ROOT_API_KEY;
}


[JsonSerializable(typeof(EmailInput))]
internal partial class AppJsonSerializerContext : JsonSerializerContext
{
Expand Down

0 comments on commit 899daa2

Please sign in to comment.