-
-
Notifications
You must be signed in to change notification settings - Fork 102
http://./
is a valid url
#146
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
Comments
I'm reopening this because we were skipping this URL in the input, but we shouldn't have. |
Why? The standard is clear on this. Labels must be between 1 and 63 bytes. If we misread the standard, can you quote the relevant section? |
I've not looked into the spec for this, but: there is a particular section in WPT labeled "domains with empty labels": https://github.com/web-platform-tests/wpt/blob/master/url/resources/urltestdata.json#L3889 |
RFC 1034: Internally, programs that manipulate domain names should represent them |
One label is reserved, and that is |
A label may contain zero to 63 characters. The null label, of length zero, is reserved for the root zone. https://en.m.wikipedia.org/wiki/Domain_Name_System |
Can you open an issue to the web-platform-tests repository? Even though you're right, removing this test from the Node repository without changing the WPT won't be possible. |
"The hierarchy of domains descends from the right to the left label in the name; each label to the left specifies a subdivision, or subdomain of the domain to the right. For example: the label example specifies a node example.com as a subdomain of the com domain, and www is a label to create www.example.com, a subdomain of example.com. Each label may contain from 1 to 63 octets. The empty label is reserved for the root node and when fully qualified is expressed as the empty label terminated by a dot. The full domain name may not exceed a total length of 253 ASCII characters in its textual representation.” https://en.m.wikipedia.org/wiki/Domain_name |
Seems related to this: servo/rust-url#554 So something can be an invalid URL, but still pass through the algorithm. |
About the link that Yagiz provided (WPT tests), All the tests/examples of the section mentioned (domains with empty labels) are not FQDN (fully qualified domain names) An example of FQDN is www.example.com, where "www" is the hostname (not required), "example" is the second-level domain (SLD), and ".com" is the top-level domain (TLD). |
I'm looking for references that state these limits/sizes/rules only apply to FQDNs. |
I couldn't find anything (but we could think about it 🤔 .. apply the rules only when there is the basic structure to be a fqdn (at least 2 non-zero labels) ) |
@miguelteixeiraa I think we should add a method to the URL struct such as
I don't think they do.
My proposal is rather to parse successfully the URL, irrespective of label lengths and so forth, but to have a method like |
@anonrig I don't think that It is a valid URL string as per https://url.spec.whatwg.org/ But that link mentions RFC 1034 only once, in passing, and does not appear to try to abide by it at all. |
To be clear, I still think it is fine to accept to parse it… |
Is this resolved? |
We can close this for now 👍 |
http://./
as an input is valid for both safari & chrome, but it's invalid for us.The text was updated successfully, but these errors were encountered: