fix: Parse Server option fileExtensions default value rejects file extensions that are less than 3 or more than 4 characters long (#8699)

This commit is contained in:
Daniel
2024-03-11 01:11:27 +11:00
committed by GitHub
parent 3fbd926b80
commit 2760381183
4 changed files with 17 additions and 5 deletions

View File

@@ -1364,6 +1364,18 @@ describe('Parse.File testing', () => {
);
});
it('default should allow common types', async () => {
await reconfigureServer({
fileUpload: {
enableForPublic: true,
},
});
for (const type of ['plain', 'txt', 'png', 'jpg', 'gif', 'doc']) {
const file = new Parse.File(`parse-server-logo.${type}`, { base64: 'ParseA==' });
await file.save();
}
});
it('works with a period in the file name', async () => {
await reconfigureServer({
fileUpload: {