Skip to content

Commit

Permalink
Add extension to reset HTTPRequestMessage sent status
Browse files Browse the repository at this point in the history
  • Loading branch information
TheArcaneBrony committed Jun 16, 2024
1 parent 805f3b7 commit d63d758
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ArcaneLibs/ArcaneLibs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<Optimize>true</Optimize>
<RunAOTCompilation>true</RunAOTCompilation>
<!-- <RunAOTCompilation>true</RunAOTCompilation>-->
<PublishTrimmed>true</PublishTrimmed>
<PublishReadyToRun>true</PublishReadyToRun>
<PublishSingleFile>true</PublishSingleFile>
<PublishReadyToRunShowWarnings>true</PublishReadyToRunShowWarnings>
<!-- <PublishReadyToRun>true</PublishReadyToRun>-->
<!-- <PublishSingleFile>true</PublishSingleFile>-->
<!-- <PublishReadyToRunShowWarnings>true</PublishReadyToRunShowWarnings>-->
<PublishTrimmedShowLinkerSizeComparison>true</PublishTrimmedShowLinkerSizeComparison>
<PublishTrimmedShowLinkerSizeComparisonWarnings>true</PublishTrimmedShowLinkerSizeComparisonWarnings>
</PropertyGroup>
Expand Down
11 changes: 11 additions & 0 deletions ArcaneLibs/Extensions/HttpExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Reflection;

namespace ArcaneLibs.Extensions;

public static class HttpExtensions {
public static void ResetSendStatus(this HttpRequestMessage request) {
typeof(HttpRequestMessage).GetField("_sendStatus", BindingFlags.NonPublic | BindingFlags.Instance)
?.SetValue(request, 0);
}

}

0 comments on commit d63d758

Please sign in to comment.