-
Notifications
You must be signed in to change notification settings - Fork 85
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: make extension patterns match the end of the file name #5652
fix: make extension patterns match the end of the file name #5652
Conversation
Does that mean that if |
If |
Co-authored-by: Sergey Vinogradov <[email protected]>
Then I simply misread your description, sorry. Thank you for the explanation and the added test! |
Co-authored-by: Sergey Vinogradov <[email protected]>
Kudos, SonarCloud Quality Gate passed!
|
* fix: make extension patterns match the end of the file name * fix: make the regex safari-compatible * refactor: remove extra lines * refactor: update naming for clarification * refactor: rename file name and extension in test * Update packages/upload/test/adding-files.test.js Co-authored-by: Sergey Vinogradov <[email protected]> * test: add a test for rejecting files that have partial extension match * refactor: extract regex logic in a loop and make it a function * Update packages/upload/src/vaadin-upload.js Co-authored-by: Sergey Vinogradov <[email protected]> * refactor: change the call in order to align with the naming change * fix: return null instead of undefined --------- Co-authored-by: Sergey Vinogradov <[email protected]>
Hi @ugur-vaadin , this commit cannot be picked to 23.3 by this bot, can you take a look and pick it manually? |
Hi @ugur-vaadin , this commit cannot be picked to 23.2 by this bot, can you take a look and pick it manually? |
…5660) * fix: make extension patterns match the end of the file name * fix: make the regex safari-compatible * refactor: remove extra lines * refactor: update naming for clarification * refactor: rename file name and extension in test * Update packages/upload/test/adding-files.test.js * test: add a test for rejecting files that have partial extension match * refactor: extract regex logic in a loop and make it a function * Update packages/upload/src/vaadin-upload.js * refactor: change the call in order to align with the naming change * fix: return null instead of undefined --------- Co-authored-by: Ugur Saglam <[email protected]> Co-authored-by: Sergey Vinogradov <[email protected]>
Description
Currently, the extensions that contain multiple dots (like .tar.gz) are rejected by
Upload
even if the extension is provided through they should be accepted. This PR changes the way the matchers work. The current approach is extracting an extension from a file name and searching for exact matches. With the changes, it will be checked whether the file name ends with one of the provided extensions.Fixes #4777
Type of change
Checklist