fix: reject credential idempotency headers

This commit is contained in:
DongHyeonka
2026-08-02 01:33:07 +09:00
parent fa2f699125
commit 15645541b7
2 changed files with 56 additions and 0 deletions
+10
View File
@@ -468,6 +468,16 @@ export function createContractHttpExecutor(
// A missing credential never downgrades into an anonymous request.
return finish(unauthenticated("NOT_STARTED", isCommand), "NOT_STARTED");
}
if (
Object.keys(patch.headers).some(
(name) => name.toLowerCase() === "idempotency-key",
)
) {
return finish(
violation("UNEXPECTED_IDEMPOTENCY_KEY", "REQUEST", "NOT_STARTED"),
"NOT_STARTED",
);
}
const headers: Record<string, string> = {
Accept: "application/json",