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
Is URL parser supposed to handle https://blah.com
?
#261
Comments
When you enter the authority state, you continue appending to buffer until
you reach the EOF code point. However, once you reach the EOF codepoint in
the authority state, you trigger Step 2 of the subalgorithm in
https://url.spec.whatwg.org/#authority-state
Step 2.2 decreases `pointer` by the length of `buffer` (Rewinding the
processing) and transitions to the `host` state if the @ flag wasn't set,
which it shouldn't be for this example.
|
@sleevi the authority state doesn't have a loop within it though. I read this algorithm as follows: after each execution of step 3 in the authority state, go back to the beginning of step 11 and switch on Maybe looping within the authority state is the intention (rather than switching on |
Further, |
You increment after the EOF check, not before. You're correct that you
That's what I meant by 2.2 of authority parsing; the EOF check happens |
Ahh, I see now, thanks! |
In walking through the URL parser state machine (https://url.spec.whatwg.org/#concept-basic-url-parser), it seems to me that on an input of "https://blah.com", the parser will return a URL whose scheme is "https" and whose other components (including hostname) are empty.
Here's the sequence of states I see happening:
=> at this point we eat up all the characters, adding them to
buffer
one by one. After eating the last character, we exit step 11 (the state machine) all together (becausec
is EOF) and do not re-execute the authority state, meaning we never reach step 2.2 of authority state that continues on to host state.Am I missing something and/or is this intentional?
The text was updated successfully, but these errors were encountered: