Skip to content

Commit 93068c5

Browse files
authored
Do not pass filename == null to FileData.append (#23)
1 parent 476122f commit 93068c5

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ Breaking changes:
99
New features:
1010

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

1316
Other improvements:
1417

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

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

4346
Bugfixes:

src/Web/XHR/FormData.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function _append(name, value, fd) {
1212
}
1313

1414
export function _appendBlob(name, value, filename, fd) {
15-
fd.append(name, value, filename);
15+
fd.append(name, value, filename === null ? undefined : filename);
1616
}
1717

1818
export function _delete(name, fd) {
@@ -28,5 +28,5 @@ export function _set(name, value, fd) {
2828
}
2929

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

0 commit comments

Comments
 (0)