Skip to content

Commit

Permalink
More succinct defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe committed Jun 21, 2021
1 parent 1fc738d commit f825d89
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions lib/StripeResource.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,9 @@ StripeResource.prototype = {
// For convenience, make some headers easily accessible on
// lastResponse.
res.requestId = headers['request-id'];

const stripeAccount = headers['stripe-account'];
if (stripeAccount) {
res.stripeAccount = stripeAccount;
}

const apiVersion = headers['stripe-version'];
if (apiVersion) {
res.apiVersion = apiVersion;
}

const idempotencyKey = headers['idempotency-key'];
if (idempotencyKey) {
res.idempotencyKey = idempotencyKey;
}
res.stripeAccount = res.stripeAccount || headers['stripe-account'];
res.apiVersion = res.apiVersion || headers['stripe-version'];
res.idempotencyKey = res.idempotencyKey || headers['idempotency-key'];
},

_makeResponseEvent(req, res, headers) {
Expand Down

0 comments on commit f825d89

Please sign in to comment.