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

invalid mime types on data uri #1607

Closed
yonjah opened this issue Oct 8, 2018 · 1 comment
Closed

invalid mime types on data uri #1607

yonjah opened this issue Oct 8, 2018 · 1 comment
Labels
bug Bug or defect
Milestone

Comments

@yonjah
Copy link

yonjah commented Oct 8, 2018

Context

  • node version: 10
  • joi version: 13.7.0
  • environment (node, browser): node
  • used with (hapi, standalone, ...): standalone Fuzzing

What are you trying to achieve or the steps to reproduce ?

When running through random generated examples on Joi I noticed the following will fail validation

const Joi  = require('joi');
const schema = Joi.string().dataUri();

console.log('text/x-script.phyton', schema.validate('data:text/x-script.phyton;charset=utf-8,some test here'));
console.log('text/x-script', schema.validate('data:text/x-script;charset=utf-8,some test here'));
console.log('text/script', schema.validate('data:text/script;charset=utf-8,some test here'));

Which result you had ?

Both text/x-script and text/x-script.phyton fail to be parsed as valid mime types and validation failed

What did you expect ?

since all mime types used are valid ones I expect all validations to pass.

Not sure if this is a major issue since it's probably never used and it might be better to only allow very simple mime types. But it might make sense to mention this limitation in the documentation

@Marsup Marsup self-assigned this Nov 11, 2018
@Marsup Marsup added the bug Bug or defect label Nov 11, 2018
@Marsup Marsup added this to the 14.0.6 milestone Nov 11, 2018
@Marsup Marsup closed this as completed in 1c9d2bb Nov 11, 2018
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug or defect
Projects
None yet
Development

No branches or pull requests

2 participants