Skip to content

Commit

Permalink
Minor changes to fix ExcludeRequestSpecialTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
csimonsson authored and ikyriak committed Aug 20, 2024
1 parent 7281d7e commit 34559e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/IdempotentAPI/Core/Idempotency.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ and not HttpContext
and not HttpResponse
and not ClaimsPrincipal
and not CancellationToken)
&& (_excludeRequestSpecialTypes is null || (_excludeRequestSpecialTypes is not null && !_excludeRequestSpecialTypes.Contains(a.GetType())))
&& (_excludeRequestSpecialTypes is null ||
(_excludeRequestSpecialTypes is not null &&
!_excludeRequestSpecialTypes.Any(t => a.GetType() == t || a.GetType().IsSubclassOf(t))))
).ToList();

string requestsDataHash = await GenerateRequestsDataHashMinimalApiAsync(filteredArguments, httpContext.Request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ public static IServiceCollection AddIdempotentMinimalAPI(this IServiceCollection
TimeSpan.FromMilliseconds(idempotencyOptions.DistributedLockTimeoutMilli),
idempotencyOptions.CacheOnlySuccessResponses,
idempotencyOptions.IsIdempotencyOptional,
idempotencyOptions.SerializerSettings);
idempotencyOptions.SerializerSettings,
idempotencyOptions.ExcludeRequestSpecialTypes
);
});

return serviceCollection;
Expand Down

0 comments on commit 34559e3

Please sign in to comment.