-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
coregood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
while idempotency-key is typically found in header, in some cases, it is better to allow application developer to decide where to get the key from.
acceptance criteria
- add an optional parameter
idempotencyKeyExtractor
tooptions
- its a method and
- takesRequestWithDefaults
as args similar toskipRequest
- return string | undefined
and then use options or use default implementation from here:
node-idempotency/packages/core/src/idempotency.ts
Lines 53 to 60 in bf04255
private getIdempotencyKey( | |
req: IdempotencyParamsWithDefaults, | |
): string | undefined { | |
const key = Object.keys(req.headers).find( | |
(key) => key.toLowerCase() === req.options.idempotencyKey.toLowerCase(), | |
); | |
return key ? (req.headers[key] as string) : undefined; | |
} |
Metadata
Metadata
Assignees
Labels
coregood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed