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: updating the node-fetch target to handle form-urlencoded requests #187

Merged
merged 3 commits into from Nov 28, 2020

Conversation

erunion
Copy link
Contributor

@erunion erunion commented Oct 15, 2020

The node-fetch target was originally sending x-www-form-urlencoded as a JSON object to body when it should be encoded with URLSearchParams as per the docs.

I also added a line break in the multipart/form-data handling so the formData.append(); calls have a little bit of room to breathe.

Copy link

@DMarby DMarby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR, looks great!
Just have one question regarding how the encodedParams are used.

src/targets/node/fetch.js Outdated Show resolved Hide resolved
@erunion
Copy link
Contributor Author

erunion commented Oct 21, 2020

@DMarby I've removed .toString() so this should be good to go!

Copy link
Contributor

@develohpanda develohpanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for doing this!

@develohpanda develohpanda merged commit 07d5ebf into Kong:master Nov 28, 2020
@erunion erunion deleted the fix/node-fetch-formdata-support branch December 1, 2020 19:33
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.

None yet

3 participants