diff --git a/lib/StripeResource.js b/lib/StripeResource.js index ab8168eef4..8161831421 100644 --- a/lib/StripeResource.js +++ b/lib/StripeResource.js @@ -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) {