-
-
Notifications
You must be signed in to change notification settings - Fork 807
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
Foreign character failure - unescape(encodeURIComponent(options.headers[key])); [Bug] #971
Comments
Thanks for reporting. So this doesn't happen when uploading without PATCH? |
Hi Rik, It relates to a header property Upload-Name. This only appears in the PATCH call and not the base networkcall if the file is small. When the filename has foreign characters, the "encodeURIComponent" and "unescape" cause the below corruption of file name which throws an error. It is browser related too, depending on how unescape has been implemented. Latest Chrome has the error. As I understand it, unescape is deprecated and non-standard, which is possibly why this error has only recently happened. In the below 24098_错误获取风险数据.png gets corrupted. I believe it relates to this code here in sendRequest.js, where unescape and encodeURIComponent are incompatible. One encodes as unicode, the other is hexadecimal. |
@lemonbob thanks for clarifying 🙏 |
Is there an existing issue for this?
Have you updated FilePond and its plugins?
Describe the bug
In sendRequest.js, the deprecated unescape() method is called on a encodeURIComponent string. The two methods are not compatible with one another and creates an error in PATCH requests when using foreign characters in the payload.
Reproduction
Upload a large file (requiring a PATCH request) that has foreign characters e.g. 'Test_错误获取风险数据.jpg'
Environment
The text was updated successfully, but these errors were encountered: