-
Couldn't load subscription status.
- Fork 24.9k
Description
| headers['content-disposition'] += '; filename="' + value.name + '"'; |
When appending a File object to a FormData instance, the filename parameter is set as is defined in the file name attribute, throwing an exception if it includes non-ASCII characters. According to the spec, it must be encoded as ISO-8859-1, and ideally, also have a filename* parameter with the name encoded as rfc-5987, so full Unicode characters can be used in the filename. To sanitize the filename parameter to be ISO-8859-1, maybe the windows-1252 npm module could be used...
Environment
Environment:
OS: Linux 4.13
Node: 9.5.0
Yarn: Not Found
npm: 5.6.0
Watchman: 4.9.0
Xcode: N/A
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: ^16.2.0 => 16.2.0
react-native: ^0.54.0 => 0.54.0
Expected Behavior
FormData instance would be able to encode a File object (in fact, a React Native "blob") with non-ASCII characters on its name (more exactly, spanish tildes).
Actual Behavior
Steps to Reproduce
- create a
FormDatainstance - append a File object or ReactNative "blob" with non-ASCII characters in the name
- send the
FormDatausingfetch() - crash
