Wrong processing of a base64 string in accordance to RFC 2397 when calling new Parse.File #1466
Closed
4 tasks done
Labels
type:bug
Impaired feature or lacking behavior that is likely assumed
New Issue Checklist
Issue Description
It is common practice to specify other parameters in the date URI such as
;filename="parse.pdf"
.I discovered this issue after generating a pdf in the browser and tried to create a new file using
Parse.File(...)
.I created the following test to point out the error:
With the following results:

The main problem is that the currently used regex doesn't take into account that there may be other parameters (such as
filename
). It takes into account onlycharset
.Steps to reproduce
Create a new Parse.File with data starting with
data:application/pdf;filename=test.pdf;base64,
Actual Outcome
new Parse.File(...)
throws an error at line 150 in ParseFile.js.Expected Outcome
new Parse.File(...)
should return a new object even when there are other parameters specified.Environment
Client
3.4.1
Logs
The text was updated successfully, but these errors were encountered: