Skip to content

Search EricksonLopez.* Ecosystem

Type a library name, NuGet package ID, .NET type, or architectural concept to search across the portal.

Guides & Recipes — Idempotency

Recommended recipes for idempotent HTTP endpoints and safe response caching.

In v2.0.0, endpoint [Idempotent] metadata takes precedence (ADR-018) and malformed Idempotency-Key headers return HTTP 400 Bad Request (RFC 9110) instead of 500:

using EricksonLopez.Idempotency.AspNetCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
namespace Example.IdempotencyRecipes;
public static class PaymentEndpoints
{
public static void MapPayments(WebApplication app)
{
app.MapPost("/payments/charge", static () => Results.Ok(new { Status = "Charged" }))
.WithIdempotency();
}
}

v2.0.0 strips Set-Cookie, Authorization, and related sensitive headers by default (SEC-001). Append any custom internal auth or correlation headers to options.ResponseHeadersBlocklist inside AddIdempotencyCore(...) so cached replays never leak session credentials across clients.