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(fetch): replace instanceof FormData check #1457

Merged
merged 1 commit into from May 20, 2022
Merged

fix(fetch): replace instanceof FormData check #1457

merged 1 commit into from May 20, 2022

Conversation

NMinhNguyen
Copy link
Contributor

See #1451 (comment)

I've tested this using esbuild with --minify and util.isFormData still works on a minified FormData class

@codecov-commenter
Copy link

codecov-commenter commented May 20, 2022

Codecov Report

Merging #1457 (2e5814b) into main (324beb6) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1457      +/-   ##
==========================================
+ Coverage   94.42%   94.44%   +0.01%     
==========================================
  Files          49       49              
  Lines        4271     4285      +14     
==========================================
+ Hits         4033     4047      +14     
  Misses        238      238              
Impacted Files Coverage Δ
lib/fetch/body.js 98.33% <100.00%> (ø)
lib/fetch/formdata.js 96.70% <100.00%> (+0.03%) ⬆️
lib/core/errors.js 100.00% <0.00%> (ø)
lib/api/api-request.js 100.00% <0.00%> (ø)
lib/core/request.js 98.66% <0.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 324beb6...2e5814b. Read the comment docs.

Copy link
Member

@ronag ronag left a comment

Choose a reason for hiding this comment

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

I don't have an opinion on this. +/- 0. @mcollina @KhafraDev @Ethan-Arrowood @targos thoughts?

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

Could you add a test?

@NMinhNguyen
Copy link
Contributor Author

Could you add a test?

I'm not sure what sort of test I could add that tests this edge case. Also util.isFormDataLike is not part of the public API. The original PR that was merged didn't have a test either, as I suspect it's quite tricky to test.

@NMinhNguyen
Copy link
Contributor Author

NMinhNguyen commented May 20, 2022

Added a simple test, let me know if it's sufficient @mcollina: https://github.com/nodejs/undici/compare/213706c71daa48705cf5a4da096ac0f23c8cbefb..2e5814b077e2695eadcc7b9b87e8e8899031e27c

How frequently do you publish new versions btw?

@mcollina
Copy link
Member

Once we have some time. At least once a month, ideally every two weeks.

@ronag ronag merged commit d023b2d into nodejs:main May 20, 2022
KhafraDev pushed a commit to KhafraDev/undici that referenced this pull request Jun 23, 2022
metcoder95 pushed a commit to metcoder95/undici that referenced this pull request Dec 26, 2022
crysmags pushed a commit to crysmags/undici that referenced this pull request Feb 27, 2024
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

4 participants