Skip to content

Commit

Permalink
Use case insensitive comparer (#2146)
Browse files Browse the repository at this point in the history
..instead of ToLower()
  • Loading branch information
softworkz committed Oct 24, 2023
1 parent 5644c25 commit 6880e58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/RestSharp/KnownHeaders.cs
Expand Up @@ -42,7 +42,7 @@ public static class KnownHeaders {
LastModified
};

static readonly HashSet<string> ContentHeadersHash = new(ContentHeaders.Select(x => x.ToLower()));
static readonly HashSet<string> ContentHeadersHash = new(ContentHeaders, StringComparer.InvariantCultureIgnoreCase);

internal static bool IsContentHeader(string key) => ContentHeadersHash.Contains(key.ToLower());
internal static bool IsContentHeader(string key) => ContentHeadersHash.Contains(key);
}

0 comments on commit 6880e58

Please sign in to comment.