Navigation Menu

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

string().hostiname() - validation of non-ASCII chars containing domains #2163

Closed
viktorija opened this issue Oct 3, 2019 · 4 comments
Closed
Assignees
Labels
feature New functionality or improvement
Milestone

Comments

@viktorija
Copy link

viktorija commented Oct 3, 2019

Hi,

There's an issue with how Joi.string().hostname() validates domain names with non-ASCII characters.
E.g. domain name: cptømrerfirma.dk fails validation, although it's a valid and existing domain.

Thanks,
Viktorija

@Marsup Marsup added the feature New functionality or improvement label Oct 3, 2019
@Marsup Marsup assigned Marsup and unassigned Marsup Oct 3, 2019
@Marsup
Copy link
Collaborator

Marsup commented Oct 3, 2019

As is expected in the RFC. It was already discussed in #1298, but it seems no one was interested in taking up this task.

@JoaoManoel
Copy link

Hi.

Can I get this issue?

I'm thinking about changing the hostRegex to:

hostRegex: /^(([a-zA-ZÀ-ÿ0-9]|[a-zA-ZÀ-ÿ0-9][a-zA-ZÀ-ÿ0-9\-]*[a-zA-ZÀ-ÿ0-9])\.)*([A-Za-zÀ-ÿ0-9]|[A-Za-zÀ-ÿ0-9][A-Za-zÀ-ÿ0-9\-]*[A-Za-zÀ-ÿ0-9])$/

What do you think?

@hueniverse
Copy link
Contributor

This is not as simple as changing the regex. I need to consolidate a few places that deal with domain names first.

@hueniverse hueniverse self-assigned this Oct 4, 2019
@hueniverse hueniverse added this to the 17.0.0 milestone Nov 17, 2019
@BanovMiroslav
Copy link

I wonder if this was really correct? Normally internationalized domains are punycode encoded.
So cptømrerfirma.dk is encoded as xn--cptmrerfirma-xjb.dk

So with that in mind should the validation of hostnames be accepting non-ASCII?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality or improvement
Projects
None yet
Development

No branches or pull requests

5 participants