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): FormData.set empties this[kState] if k exists #1017

Merged
merged 4 commits into from
Sep 3, 2021

Conversation

rayw000
Copy link
Contributor

@rayw000 rayw000 commented Sep 3, 2021

What changed

  1. FormData.set(k, v) will empty the entire this[kState] if k exists. This is not what it is supposed to do. Fix it.
  2. Improve coverage of lib/fetch/formdata.js

lib/fetch/formdata.js Outdated Show resolved Hide resolved
lib/fetch/formdata.js Outdated Show resolved Hide resolved
lib/fetch/formdata.js Outdated Show resolved Hide resolved
lib/fetch/formdata.js Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Sep 3, 2021

Codecov Report

Merging #1017 (c6f2e0f) into main (1c2259c) will increase coverage by 0.33%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1017      +/-   ##
==========================================
+ Coverage   94.25%   94.59%   +0.33%     
==========================================
  Files          37       37              
  Lines        3605     3605              
==========================================
+ Hits         3398     3410      +12     
+ Misses        207      195      -12     
Impacted Files Coverage Δ
lib/fetch/formdata.js 100.00% <100.00%> (+15.58%) ⬆️

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 1c2259c...c6f2e0f. Read the comment docs.

Co-authored-by: Robert Nagy <ronagy@icloud.com>
@ronag
Copy link
Member

ronag commented Sep 3, 2021

Thanks!

@ronag ronag merged commit 22d6bd2 into nodejs:main Sep 3, 2021
KhafraDev pushed a commit to KhafraDev/undici that referenced this pull request Jun 23, 2022
* fix(fetch): form.set() empties kState if k exists

* test(fetch): improve coverage

* fix(fetch): better performance of FormData.set()

* fix(fetch): use ES6 syntax

Co-authored-by: Robert Nagy <ronagy@icloud.com>

Co-authored-by: Robert Nagy <ronagy@icloud.com>
crysmags pushed a commit to crysmags/undici that referenced this pull request Feb 27, 2024
* fix(fetch): form.set() empties kState if k exists

* test(fetch): improve coverage

* fix(fetch): better performance of FormData.set()

* fix(fetch): use ES6 syntax

Co-authored-by: Robert Nagy <ronagy@icloud.com>

Co-authored-by: Robert Nagy <ronagy@icloud.com>
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.

4 participants