Skip to content

Commit

Permalink
Streaming fixes (#1187)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe authored Jul 9, 2021
1 parent 7a7728b commit 6f8c7df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/StripeResource.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ StripeResource.prototype = {
((res || {}).headers || {})['retry-after']
);
} else {
if (options.streaming && res.statusCode <= 400) {
if (options.streaming && res.statusCode < 400) {
return this._streamingResponseHandler(req, callback)(res);
}
return this._jsonResponseHandler(req, callback)(res);
Expand Down
2 changes: 2 additions & 0 deletions types/lib.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ declare module 'stripe' {
autoPagingToArray(opts: {limit: number}): Promise<Array<T>>;
}

export type StripeStreamResponse = NodeJS.ReadableStream;

/**
* The Stripe API uses url-encoding for requests, and stripe-node encodes a
* `null` param as an empty string, because there is no concept of `null`
Expand Down

0 comments on commit 6f8c7df

Please sign in to comment.