Skip to content
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

fix: Parse Server option fileUpload.fileExtensions does not work with an array of extensions #8688

Conversation

BartoszMarganiec
Copy link
Contributor

Testing uploaded file extension against every pattern provided in file upload config extensions.

Pull Request

Issue

Closes: #8687

Approach

Run regexp test for every pattern in the fileExtensions array.

@parse-github-assistant
Copy link

Thanks for opening this pull request!

@BartoszMarganiec BartoszMarganiec changed the title Fix: testing uploaded file extension fix: testing uploaded file extension Jul 15, 2023
@parse-github-assistant
Copy link

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title fix: testing uploaded file extension fix: Testing uploaded file extension Jul 15, 2023
@mtrezza
Copy link
Member

mtrezza commented Jul 15, 2023

Could you add a test case in which you add an array of extensions? You can just copy and modify the existing test. The test should fail without the fix you've already added and pass with the fix.

@codecov
Copy link

codecov bot commented Jul 15, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (c9b5971) 94.37% compared to head (f5c3818) 94.37%.

❗ Current head f5c3818 differs from pull request most recent head f5e4205. Consider uploading reports for the commit f5e4205 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##            alpha    #8688   +/-   ##
=======================================
  Coverage   94.37%   94.37%           
=======================================
  Files         185      185           
  Lines       14761    14761           
=======================================
  Hits        13931    13931           
  Misses        830      830           
Impacted Files Coverage Δ
src/Routers/FilesRouter.js 93.29% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@BartoszMarganiec
Copy link
Contributor Author

I added a test, but i think the other tests should be reviewed, for example the test case "works with array" doesn't provide any value in my opinion and its name should be definitely changed.

spec/ParseFile.spec.js Outdated Show resolved Hide resolved
@BartoszMarganiec BartoszMarganiec requested a review from mtrezza July 17, 2023 14:34
spec/ParseFile.spec.js Outdated Show resolved Hide resolved
@BartoszMarganiec BartoszMarganiec requested a review from mtrezza July 17, 2023 16:53
Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@mtrezza mtrezza requested a review from a team July 17, 2023 22:32
@mtrezza mtrezza changed the title fix: Testing uploaded file extension fix: Parse Server option fileUpload.fileExtensions does not work with an array of extensions Jul 17, 2023
@mtrezza mtrezza removed the request for review from a team July 17, 2023 22:34
@mtrezza mtrezza merged commit 6a4a00c into parse-community:alpha Jul 17, 2023
parseplatformorg pushed a commit that referenced this pull request Jul 17, 2023
# [6.3.0-alpha.6](6.3.0-alpha.5...6.3.0-alpha.6) (2023-07-17)

### Bug Fixes

* Parse Server option `fileUpload.fileExtensions` does not work with an array of extensions ([#8688](#8688)) ([6a4a00c](6a4a00c))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 6.3.0-alpha.6

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Jul 17, 2023
parseplatformorg pushed a commit that referenced this pull request Sep 16, 2023
# [6.4.0-beta.1](6.3.0...6.4.0-beta.1) (2023-09-16)

### Bug Fixes

* Parse Server option `fileUpload.fileExtensions` does not work with an array of extensions ([#8688](#8688)) ([6a4a00c](6a4a00c))
* Redis 4 does not reconnect after unhandled error ([#8706](#8706)) ([2b3d4e5](2b3d4e5))
* Remove config logging when launching Parse Server via CLI ([#8710](#8710)) ([ae68f0c](ae68f0c))
* Server does not start via CLI when `auth` option is set ([#8666](#8666)) ([4e2000b](4e2000b))

### Features

* Add conditional email verification via dynamic Parse Server options `verifyUserEmails`, `sendUserEmailVerification` that now accept functions ([#8425](#8425)) ([44acd6d](44acd6d))
* Add property `Parse.Server.version` to determine current version of Parse Server in Cloud Code ([#8670](#8670)) ([a9d376b](a9d376b))
* Add TOTP authentication adapter ([#8457](#8457)) ([cc079a4](cc079a4))

### Performance Improvements

* Improve performance of recursive pointer iterations ([#8741](#8741)) ([45a3ed0](45a3ed0))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 6.4.0-beta.1

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Sep 16, 2023
parseplatformorg pushed a commit that referenced this pull request Sep 20, 2023
# [6.4.0-alpha.1](6.3.0...6.4.0-alpha.1) (2023-09-20)

### Bug Fixes

* Parse Server option `fileUpload.fileExtensions` does not work with an array of extensions ([#8688](#8688)) ([6a4a00c](6a4a00c))
* Redis 4 does not reconnect after unhandled error ([#8706](#8706)) ([2b3d4e5](2b3d4e5))
* Remove config logging when launching Parse Server via CLI ([#8710](#8710)) ([ae68f0c](ae68f0c))
* Server does not start via CLI when `auth` option is set ([#8666](#8666)) ([4e2000b](4e2000b))

### Features

* Add conditional email verification via dynamic Parse Server options `verifyUserEmails`, `sendUserEmailVerification` that now accept functions ([#8425](#8425)) ([44acd6d](44acd6d))
* Add context to Cloud Code Triggers `beforeLogin` and `afterLogin` ([#8724](#8724)) ([a9c34ef](a9c34ef))
* Add property `Parse.Server.version` to determine current version of Parse Server in Cloud Code ([#8670](#8670)) ([a9d376b](a9d376b))
* Add TOTP authentication adapter ([#8457](#8457)) ([cc079a4](cc079a4))

### Performance Improvements

* Improve performance of recursive pointer iterations ([#8741](#8741)) ([45a3ed0](45a3ed0))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 6.4.0-alpha.1

parseplatformorg pushed a commit that referenced this pull request Nov 16, 2023
# [6.4.0](6.3.1...6.4.0) (2023-11-16)

### Bug Fixes

* Parse Server option `fileUpload.fileExtensions` does not work with an array of extensions ([#8688](#8688)) ([6a4a00c](6a4a00c))
* Redis 4 does not reconnect after unhandled error ([#8706](#8706)) ([2b3d4e5](2b3d4e5))
* Remove config logging when launching Parse Server via CLI ([#8710](#8710)) ([ae68f0c](ae68f0c))
* Server does not start via CLI when `auth` option is set ([#8666](#8666)) ([4e2000b](4e2000b))

### Features

* Add conditional email verification via dynamic Parse Server options `verifyUserEmails`, `sendUserEmailVerification` that now accept functions ([#8425](#8425)) ([44acd6d](44acd6d))
* Add property `Parse.Server.version` to determine current version of Parse Server in Cloud Code ([#8670](#8670)) ([a9d376b](a9d376b))
* Add TOTP authentication adapter ([#8457](#8457)) ([cc079a4](cc079a4))

### Performance Improvements

* Improve performance of recursive pointer iterations ([#8741](#8741)) ([45a3ed0](45a3ed0))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 6.4.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-alpha Released as alpha version state:released-beta Released as beta version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File extensions config doesn't work properly for array
3 participants