-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Closed
Labels
BugPlatform: LinuxBuilding on Linux.Building on Linux.StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
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
FormData
instance - append a File object or ReactNative "blob" with non-ASCII characters in the name
- send the
FormData
usingfetch()
- crash
jaydenseric, khorark, Ashoat, frenberg and pavinduLakshan
Metadata
Metadata
Assignees
Labels
BugPlatform: LinuxBuilding on Linux.Building on Linux.StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.