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

isDataURI: is not matching valid MIME types with an underscore #2121

Closed
pano9000 opened this issue Dec 6, 2022 · 0 comments · Fixed by #2122
Closed

isDataURI: is not matching valid MIME types with an underscore #2121

pano9000 opened this issue Dec 6, 2022 · 0 comments · Fixed by #2122
Labels

Comments

@pano9000
Copy link
Contributor

pano9000 commented Dec 6, 2022

Describe the bug
isDataURI will return false for MIME types, that have an underscore in them
Same issue as #2119

Examples
(bit of a faux example, as the base64 part is not really a "real" application/media_control+xml type file, but that is beyond the point here, as we only care for the MIME type part here)

data:application/media_control+xml;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIBAMAAAA2IaO4AAAAFVBMVEXk5OTn5+ft7e319fX29vb5+fn///++GUmVAAAALUlEQVQIHWNICnYLZnALTgpmMGYIFWYIZTA2ZFAzTTFlSDFVMwVyQhmAwsYMAKDaBy0axX/iAAAAAElFTkSuQmCC

should return true, but currently returns false

I'll send a PR to fix this in a few moments

pano9000 added a commit to pano9000/validator.js that referenced this issue Dec 6, 2022
pano9000 added a commit to pano9000/validator.js that referenced this issue Dec 6, 2022
also match valid MIME types with an underscore in their name

fixes validatorjs#2121
profnandaa pushed a commit that referenced this issue Jan 22, 2023
…2122)

* test(isDataURI): add test case with an underscore in MIME type

preparation for fixing #2121

* fix(isDataURI): add underscore to RegExp

also match valid MIME types with an underscore in their name

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

Successfully merging a pull request may close this issue.

1 participant