Skip to content

Do not pass filename == null to FileData.append #23

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

Merged
merged 1 commit into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Breaking changes:
New features:

Bugfixes:
- Passing `Nothing` for the `filename` parameter to `appendBlob` and `setBlob`
has the effect of using the filename from the `File` object, rather than
making filename equal to `"null"`.

Other improvements:

Expand Down Expand Up @@ -37,7 +40,7 @@ Breaking changes:
- Added support for PureScript 0.14 and dropped support for all previous versions (#10)

New features:
- Added roles declarations to forbid unsafe coercions (#7)
- Added roles declarations to forbid unsafe coercions (#7)
- Can create a new `FormData` from `HTMLFormElement` (#15)

Bugfixes:
Expand Down
4 changes: 2 additions & 2 deletions src/Web/XHR/FormData.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function _append(name, value, fd) {
}

export function _appendBlob(name, value, filename, fd) {
fd.append(name, value, filename);
fd.append(name, value, filename === null ? undefined : filename);
}

export function _delete(name, fd) {
Expand All @@ -28,5 +28,5 @@ export function _set(name, value, fd) {
}

export function _setBlob(name, value, filename, fd) {
fd.set(name, value, filename);
fd.set(name, value, filename === null ? undefined : filename);
}