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

<vaadin-upload> accept regex failure when mimetype contains '+' #4372

Closed
srijken opened this issue Aug 19, 2022 · 0 comments · Fixed by #4641
Closed

<vaadin-upload> accept regex failure when mimetype contains '+' #4372

srijken opened this issue Aug 19, 2022 · 0 comments · Fixed by #4641

Comments

@srijken
Copy link
Contributor

srijken commented Aug 19, 2022

Description

I added an uploader for SVG files like this:

<vaadin-upload accept="image/svg+xml"

Because the regex is calculated incorrectly, it doesn't accept svg files.

Regex is calculated to be ^(image/svg+xml)$, but the + sign should be escaped here.

Expected outcome

I can upload SVG files

Minimal reproducible example

<vaadin-upload accept="image/svg+xml"></vaadin-upload>

Steps to reproduce

  1. Add the snippet above
  2. Upload svg file
  3. File is rejected

Environment

Vaadin version(s): 23.1.4
OS: MacOS 12.3.1 / Chrome 104.0.5112.101

Browsers

Issue is not browser related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants