Skip to content

Commit

Permalink
Store response reference in HttpContext.Items for use by Idempotency …
Browse files Browse the repository at this point in the history
…libs
  • Loading branch information
KateyBee committed Apr 23, 2024
1 parent afda1ed commit 2e9a079
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Src/Directory.Build.props
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>

<Version>5.24.0.4-beta</Version>
<Version>5.24.0.5-beta</Version>

<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
Expand Down
2 changes: 2 additions & 0 deletions Src/Library/Endpoint/Endpoint.cs
Expand Up @@ -121,6 +121,8 @@ internal override async Task ExecAsync(CancellationToken ct)
{
await RunPostProcessors(Definition.PostProcessorList, req, _response!, HttpContext, edi, ValidationFailures, ct);

HttpContext.Items["FastEndpointsResponse"] = _response; //for use by idempotency libraries

//throw here if an exception has been captured and a post-processor hasn't handled it.
//without this UseDefaultExceptionHandler() or user's custom exception handling middleware becomes useless as the exception is silently swallowed.
if (edi is not null && !HttpContext.EdiIsHandled())
Expand Down

0 comments on commit 2e9a079

Please sign in to comment.