[whatwg/url] Authority State of URL Parser has unconditional Validation Error? (#408)

I'm having a hard time implementing the Authority state section of the URL parser. The rest of the state machine seems so straightforward and my implementation works properly for every section except Authority. Here's an example scenario my current implementation arrives on with a starting input of `https://foo:bar@www.google.com`:

```json
{
    "url": {
        "scheme": "https",
        "host": null,
        "port": null,
        "username": null,
        "password": null,
        "query": null,
        "fragment": null,
        "path": []
    },
    "base": null,
    "state": "authority",
    "buffer": "foo:bar",
    "c": "@",
    "remaining": "www.google.com"
}
```

>From the spec it seems that because `c` is `@` we would receive a validation error?  I also don't see how the username and password can be set without hitting a validation error? What am I missing about this section?

https://url.spec.whatwg.org/commit-snapshots/6800342832fdf99caa265d0106cf984123716d9d/#url-parsing



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/408

Received on Thursday, 2 August 2018 04:49:14 UTC