Skip to content

Commit 268bafc

Browse files
committed
Made headers case-insensitive
1 parent 7083b7e commit 268bafc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

LessAnnoyingHttp/Http.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static Response Get(string endpoint, Header[]? headers = null) {
3636
return new Response { IsSuccessful = false, Body = "", Exception = e };
3737
}
3838

39-
return new Response { IsSuccessful = response.IsSuccessStatusCode, Body = response.Content.ReadAsStringAsync().Result, Headers = response.Headers.ToDictionary(), StatusCode = response.StatusCode };
39+
return new Response { IsSuccessful = response.IsSuccessStatusCode, Body = response.Content.ReadAsStringAsync().Result, Headers = new Dictionary<string, IEnumerable<string>>(response.Headers.ToDictionary(), StringComparer.OrdinalIgnoreCase), StatusCode = response.StatusCode };
4040
}
4141

4242
private static Response BodyRequest(string endpoint, HttpMethod method, string body, Header[]? headers, string contentType) {
@@ -61,7 +61,7 @@ private static Response BodyRequest(string endpoint, HttpMethod method, string b
6161
return new Response { IsSuccessful = false, Body = "", Exception = e };
6262
}
6363

64-
return new Response { IsSuccessful = response.IsSuccessStatusCode, Body = response.Content.ReadAsStringAsync().Result, Headers = response.Headers.ToDictionary(), StatusCode = response.StatusCode };
64+
return new Response { IsSuccessful = response.IsSuccessStatusCode, Body = response.Content.ReadAsStringAsync().Result, Headers = new Dictionary<string, IEnumerable<string>>(response.Headers.ToDictionary(), StringComparer.OrdinalIgnoreCase), StatusCode = response.StatusCode };
6565
}
6666

6767
/// <summary>

LessAnnoyingHttp/LessAnnoyingHttp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net8.0</TargetFramework>
5-
<Version>1.2.0</Version>
5+
<Version>1.3.0</Version>
66
<Authors>DemonExposer</Authors>
77
<Description>Simpler HTTP requests in .NET</Description>
88
<PackageTags>HTTP</PackageTags>

0 commit comments

Comments
 (0)