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): prevent Illegal invocations of the FileLike class #1207

Merged

Conversation

RaisinTen
Copy link
Contributor

Signed-off-by: Darshan Sen [email protected]

@RaisinTen RaisinTen changed the title fix(fetch): prevent Illegal invocations of the FileLike class fix(fetch): prevent Illegal invocations of the FileLike class Feb 6, 2022
@codecov-commenter
Copy link

codecov-commenter commented Feb 6, 2022

Codecov Report

Merging #1207 (8b1c5a1) into main (a54b8f5) will decrease coverage by 0.27%.
The diff coverage is 14.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1207      +/-   ##
==========================================
- Coverage   93.78%   93.50%   -0.28%     
==========================================
  Files          43       43              
  Lines        4021     4035      +14     
==========================================
+ Hits         3771     3773       +2     
- Misses        250      262      +12     
Impacted Files Coverage Δ
lib/fetch/file.js 52.08% <14.28%> (-15.57%) ⬇️

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 a54b8f5...8b1c5a1. Read the comment docs.

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.

Why is this needed? Is it part of the spec?

@RaisinTen
Copy link
Contributor Author

Why is this needed?

I added the validators because the rest of the methods both in File (even the ones inherited from require('buffer').Blob) and FileLike had them and I couldn't think of a good reason why we shouldn't validate this.

Is it part of the spec?

Is FileLike a part of the spec? It was added in #1110 without any spec link. I was looking for it in https://w3c.github.io/FileAPI/#dfn-file but I couldn't find it. Do you have a link to the FileLike spec?

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

@mcollina mcollina merged commit 4c206cb into nodejs:main Feb 6, 2022
@RaisinTen RaisinTen deleted the prevent-Illegal-invocations-of-FileLike branch February 6, 2022 15:42
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.

4 participants