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

Incorrect hostname validation #2648

Closed
Fruch6807 opened this issue Aug 2, 2021 · 0 comments · Fixed by #2649
Closed

Incorrect hostname validation #2648

Fruch6807 opened this issue Aug 2, 2021 · 0 comments · Fixed by #2649
Labels
bug Bug or defect
Milestone

Comments

@Fruch6807
Copy link

Support plan

  • is this issue currently blocking your project? (yes/no): no
  • is this issue affecting a production system? (yes/no): no

Context

  • node version: v12.13.1
  • module version with issue: v17.4.2
  • last module version without issue: N/A
  • environment (e.g. node, browser, native): node
  • used with (e.g. hapi application, another framework, standalone, ...): standalone
  • any other relevant information: N/A

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

Joi.string().hostname() handles CIDR notation as a valid hostname:

const Joi = require('joi');

const hostnameSchema = Joi.string().hostname();

console.log(hostnameSchema.validate('10.10.10.10/24'));

What was the result you got?

No validation error

What result did you expect?

A validation error with a "value" must be a valid hostname message field

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

Successfully merging a pull request may close this issue.

2 participants