Skip to content

Reject single '.' character for hostname formats #759

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

Merged

Conversation

sirosen
Copy link
Contributor

@sirosen sirosen commented Jan 30, 2025

This is a follow-up from #758.

Add negative tests for "." for hostname formats, based on RFC 1123 not allowing this value.

A single dot is not allowed under RFC 1123.
@sirosen sirosen force-pushed the hostname-format-reject-single-dot branch from f1beee8 to 4a3efd1 Compare January 30, 2025 16:04
@sirosen sirosen marked this pull request as ready for review January 30, 2025 16:04
@sirosen sirosen requested a review from a team as a code owner January 30, 2025 16:04
@Julian
Copy link
Member

Julian commented Jan 30, 2025

I've seen this of course, but won't look carefully at it until resolving some breaking changes I have to deal with as part of updating the test suite in my implementation (coming from PRs here which moved remotes around and which break me running the test suite in the Python package), so that's going to be a bit higher priority for me to fix with the limited time I have at the moment, but I'll try to have a look after that, as of course this seems notionally right! Obviously someone else might merge in the interim if it looks right to them (and thanks as usual of course!).

@sirosen
Copy link
Contributor Author

sirosen commented Jan 30, 2025

I'm just trying to clean up from my accidental push to python-jsonschema! 😅

This was one of the two tests I introduced over there. But no pressure of course!

@Julian
Copy link
Member

Julian commented Jan 30, 2025

I removed it as part of the merge (so we're back to good I think in terms of being able to merge future changes, namely this PR after being merged here), though I haven't pushed yet because of those aforementioned issues :/ which are completely unrelated to you obviously. I hope later today to give it another shot.

@Julian
Copy link
Member

Julian commented Jan 31, 2025

OK, now that I've done that downstream -- yeah thanks this looks good to me as well -- for any future reference, at least one part of RFC 1123 that clearly indicates this isn't allowed is:

One aspect of host name syntax is hereby changed: the restriction on the first character is relaxed to allow either a letter or a digit.

@Julian Julian merged commit e524505 into json-schema-org:main Jan 31, 2025
3 checks passed
@sirosen sirosen deleted the hostname-format-reject-single-dot branch January 31, 2025 18:29
OptimumCode added a commit to OptimumCode/json-schema-validator that referenced this pull request Feb 3, 2025
Based on
json-schema-org/JSON-Schema-Test-Suite#759 it is
not allowed to have a single dot in the hostname (and IDN hostname). The
hostname validator already had the correct behavior but the IDN hostname
validator did not
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants