You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The hostname format checker currently does not allow hostnames without a domain part, hence a single label like localhost is rejected as invalid hostname.
This is caused by class FQDN from fqdn assuming a minimum of two labels.
AFAIK, single labels are not excluded by the RFC 1123 and class FQDN can be forced to accept also single labels in its constructor (min_labels=1).
If rejecting single labels is not the intended behavior, I will send a PR.
The text was updated successfully, but these errors were encountered:
Thanks! The first step here (assuming you're correct, which I have to double check the RFC, but willing to initially take your word for it :) is to add a test upstream to the official test suite (which I also maintain).
That's here -- could you perhaps have a look there at the hostname (and IDN hostname) format tests, see if you follow how to add one, and then once it's merged there we can pull and add the suggested fix to how we call fqdn.
Julian
added
Bug
Something doesn't work the way it should.
Needs Test Upstream
Issues that need to have a test added to https://github.com/json-schema-org/JSON-Schema-Test-Suite
labels
Sep 12, 2023
Julian
removed
the
Needs Test Upstream
Issues that need to have a test added to https://github.com/json-schema-org/JSON-Schema-Test-Suite
label
Feb 16, 2024
The hostname format checker currently does not allow hostnames without a domain part, hence a single label like
localhost
is rejected as invalid hostname.This is caused by class
FQDN
fromfqdn
assuming a minimum of two labels.AFAIK, single labels are not excluded by the RFC 1123 and class
FQDN
can be forced to accept also single labels in its constructor (min_labels=1
).If rejecting single labels is not the intended behavior, I will send a PR.
The text was updated successfully, but these errors were encountered: