From 3ec1ecb94b31d39489e08c7a0eb4e47f3b4eeca4 Mon Sep 17 00:00:00 2001 From: Nicolas DUBIEN Date: Sun, 4 Oct 2026 21:44:55 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Complete=20the=20RFC=20reference?= =?UTF-8?q?=20for=20digit-leading=20hostnames=20(#7395)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description > AI-agent disclosure: this PR was authored by an automated agent (Codex) and has not been line-by-line reviewed by a human before submission. The subdomain-label helper leaves the source of digit-leading hostname support as an unfinished placeholder. Replace it with RFC 1123 section 2.1 and a direct link to the specification: https://www.rfc-editor.org/rfc/rfc1123.html#section-2.1. Validation: checked the first-character rule against that section; changed-file oxfmt and `git diff --check` pass. Comment-only change; empty changeset records no release impact. ## Checklist — _Don't delete this checklist and make sure you do the following before opening the PR_ - [ ] I have a full understanding of every line in this PR — whether the code was hand-written, AI-generated (our [AI Policy](https://github.com/dubzzz/fast-check/blob/main/AI_POLICY.md)), copied from external sources or produced by any other tool - [ ] I flagged the impact of my change (minor / patch / major) either by running `pnpm run bump` or by following the instructions from the changeset bot - [ ] I kept this PR focused on a single concern and did not bundle unrelated changes - [ ] I followed the [gitmoji](https://gitmoji.dev/) specification for the name of the PR, including the package scope (e.g. `🐛(vitest) Something...`) when the change targets a package other than `fast-check` - [ ] I added relevant tests and they would have failed without my PR (when applicable) --- .../_internals/helpers/InvalidSubdomainLabelFiIter.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/fast-check/src/arbitrary/_internals/helpers/InvalidSubdomainLabelFiIter.ts b/packages/fast-check/src/arbitrary/_internals/helpers/InvalidSubdomainLabelFiIter.ts index 78c71fff..902a5a58 100644 --- a/packages/fast-check/src/arbitrary/_internals/helpers/InvalidSubdomainLabelFiIter.ts +++ b/packages/fast-check/src/arbitrary/_internals/helpers/InvalidSubdomainLabelFiIter.ts @@ -8,7 +8,10 @@ export function filterInvalidSubdomainLabel(subdomainLabel: string): boolean { // - ::= | // - ::= any one of the 52 alphabetic characters A through Z in upper case and a through z in lower case // - ::= any one of the ten digits 0 through 9 - // If we strictly follow RFC 1034, 9gag would be an invalid domain. Support for such domain has been added by .... + // If we strictly follow RFC 1034, 9gag would be an invalid domain. + // Support for such domain has been added by RFC 1123 section 2.1. + // It allows a hostname to start with a letter or a digit. + // https://www.rfc-editor.org/rfc/rfc1123.html#section-2.1 if (subdomainLabel.length > 63) { return false; // invalid, it seems that this restriction has been relaxed in modern web browsers } -- 2.51.2