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

Explicitly reject invalid types for puter.fs.upload() and .write() payloads #406

Merged
merged 2 commits into from
May 22, 2024

Conversation

AtkinsSJ
Copy link
Collaborator

Previously, this would crash in upload() when trying to iterate the entries array, which is undefined when the items parameter is an unsupported type.


I did notice when looking at this too, that our docs for upload() says:

items can be an InputFileList, FileList, Array of File objects, or an Array of Blob objects.

but the code says (correctly as far as I can tell):

'items' could be a DataTransferItemList, FileList, File, or an array of any of these,

So that could be confusing for anyone trying to use this!

Previously, this would crash in upload() when trying to iterate the
`entries` array, which is undefined when the `items` parameter is an
unsupported type.
@KernelDeimos KernelDeimos merged commit b15dc31 into HeyPuter:main May 22, 2024
6 checks passed
@AtkinsSJ AtkinsSJ deleted the fs-upload-data-type-error branch May 22, 2024 16:13
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

2 participants