-
Notifications
You must be signed in to change notification settings - Fork 149
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
Parser for Domain attributes #1939
Comments
Good question, what should happen? Section 5.5 Step 9, sub-step 1 states
It looks like "domain-match" is doing the heavy lifting in that alogithm. Section 5.1.3 Domain Matching
Because this is an IP address, only the top condition is applicable meaning that since a cookie with a That's straightforward enough, assuming we agree on my interpretation here.
Also a good and (unfortunately) different question. Well for Chrome 98 it seems we do set the cookie, oops. This feels like it's an implementation bug, as the spec's instructions seem reasonable, but do you have a different take Anne? |
I think using string equality with the I was concerned with how Domain Matching knows something is an IP address, but I suppose that "The string is a host name (i.e., not an IP address)." is not something it needs to know about the string, but about the domain string it presumably has previously parsed and thus knows about. That might be worth clarifying there to avoid giving the impression that the string needs to be parsed. |
Are you suggesting that |
Maybe that's good enough. Ideally the spec would just reuse the URL Standard data types, but that's probably not attainable. |
Hmm, that change on its own might cause issues Let's pretend we modified the algorithm to only look at the domain string
If a response from Maybe we could get away with a warning that no parsing of the input string should occur aside from checking if it's an IP address. But then we've worked our way back to your original point of "I was concerned with how Domain Matching knows something is an IP address" |
I was under the mistaken impression that string and not domain string was obtained from the cookie Now having said that, I'm not sure it works as well for IPv6. There's multiple ways to spell an IPv6 address and if you don't canonicalize (by parsing) you essentially have to spell them the way the URL Standard will canonicalize them. So you cannot write |
I don't think that the definition permits IPv6 addresses, so that might be moot. Adding brackets to the grammar might cause a new kind of problem.
(Curiously, I went to RFC 1035 Section 3.5 by accident, which talks about in-addr.arpa. It's not that.) |
Good point, but those requirements have no bearing on user agents. The sections are quite explicit about that. |
Step 8 of the host parsing algorithm in the WhatWG spec has a very simple rule for distinguish IP addresses. It says "If asciiDomain ends in a number, then return the result of IPv4 parsing asciiDomain." We should either reference that or (given how simple it is) copy the "ends in a number" bit. I believe that |
It does seem worth explicitly clarifying how IPv6 interacts here as well. (ie, is it ever allowed?) If we explicitly support legacy IPv4 do we also need to support IPv6 somehow per https://www.iab.org/2016/11/07/iab-statement-on-ipv6/ ? |
Yeah, I think that maybe IPv6 is permitted, but I can't be sure. IPv6 would be identified by the leading '[' |
If a resource on
127.0.0.1
sets a cookie with aDomain
attribute set to127.1
, does that work? (Spoiler: it works if it was passed through the host parser, which seems like a prerequisite to determine whether it's an IP address or not as needed by Domain Matching.)(I raised this in #1707 but it seems that's exclusively used for the non-ASCII bytes discussion.)
The text was updated successfully, but these errors were encountered: