Skip to content

Commit 6880e58

Browse files
authored
Use case insensitive comparer (#2146)
..instead of ToLower()
1 parent 5644c25 commit 6880e58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/RestSharp/KnownHeaders.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static class KnownHeaders {
4242
LastModified
4343
};
4444

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

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

0 commit comments

Comments
 (0)