Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update FetchHttpClient to send empty string for empty POST/PUT/PATCH requests. #1527

Merged
merged 2 commits into from
Aug 24, 2022

Conversation

dcr-stripe
Copy link
Contributor

r? @kamil-stripe

Summary

Updates the FetchHttpClient to explicitly send an empty string for methods which expect a payload but have no request data.

Motivation

Fixes #1519

Deno injects a second Content-Length header when we don't specify body explicitly (ie. pass a concrete value other than undefined), causing Stripe POST requests without bodies to fail. By passing an explicit body, this will no longer happen.

Release plan

This is a clean cherry-pick of #1521 with nothing changed. It has been tested in beta and confirmed by reporter that it fixes the issue.

@stripe-ci stripe-ci assigned dcr-stripe and unassigned kamil-stripe Aug 24, 2022
@dcr-stripe dcr-stripe merged commit 3c65dab into master Aug 24, 2022
@richardm-stripe richardm-stripe deleted the dcr-fix branch April 4, 2023 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Deno] Invalid JSON received from the Stripe API
2 participants