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

validate.URL rejects hostnames with no dots #664

sduthil opened this Issue Jul 31, 2017 · 1 comment


None yet
3 participants

sduthil commented Jul 31, 2017

My current use case:
I use Docker and I need to set some URL fields for the containers to communicate together. The URL fields look like http://third-party/test, where third-party is the hostname of one of the containers.

Currently, validate.URL rejects this URL as invalid, because there is no dot in the hostname third-party.

Other use cases include:

  • a local network in the same subdomain, where hosts are queried using only the name of the machine, not the FQDN, having configured the DNS resolver to search automatically, for example querying webserver instead of
  • a stricly-local network, where there are no public TLD available, and all machines are name machine1, machine2, etc. very similarly to the Docker internal network

sduthil added a commit to sduthil/marshmallow that referenced this issue Jul 31, 2017

fix marshmallow-code#664: validate.URL: allow hostnames with no dots
reason: a hostname with no dots is valid, and useful in some cases,
e.g. a host in the same subdomain than the client, a shorter alias to
a longer hostname, a local network without TLD

sduthil added a commit to wazo-pbx/wazo-webhookd that referenced this issue Jul 31, 2017

sloria added a commit that referenced this issue Oct 23, 2017

Merge pull request #674 from sduthil/url-require-tld
fix #664: validate.URL: add option to allow hostnames with no dots

@sloria sloria closed this Oct 23, 2017


This comment has been minimized.

jarmani commented Oct 29, 2017

Wouldn't it be interessting to do the same for email validator ?

Currently the validation is not symetrical to browser email validation.

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