{"action":"created","issue":{"url":"https://api.github.com/repos/whatwg/url/issues/259","repository_url":"https://api.github.com/repos/whatwg/url","labels_url":"https://api.github.com/repos/whatwg/url/issues/259/labels{/name}","comments_url":"https://api.github.com/repos/whatwg/url/issues/259/comments","events_url":"https://api.github.com/repos/whatwg/url/issues/259/events","html_url":"https://github.com/whatwg/url/issues/259","id":209887390,"number":259,"title":"username/password/port should be removed when \"file\" is added as scheme","user":{"login":"watilde","id":1716463,"avatar_url":"https://avatars.githubusercontent.com/u/1716463?v=3","gravatar_id":"","url":"https://api.github.com/users/watilde","html_url":"https://github.com/watilde","followers_url":"https://api.github.com/users/watilde/followers","following_url":"https://api.github.com/users/watilde/following{/other_user}","gists_url":"https://api.github.com/users/watilde/gists{/gist_id}","starred_url":"https://api.github.com/users/watilde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/watilde/subscriptions","organizations_url":"https://api.github.com/users/watilde/orgs","repos_url":"https://api.github.com/users/watilde/repos","events_url":"https://api.github.com/users/watilde/events{/privacy}","received_events_url":"https://api.github.com/users/watilde/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-02-23T21:20:16Z","updated_at":"2017-02-25T15:54:39Z","closed_at":"2017-02-25T15:54:39Z","body":"According to [this section](https://url.spec.whatwg.org/#url-miscellaneous) in the spec, the file scheme can't have `username/password/port`. I think they also should be removed automatically when `file:` is added as the scheme. Currently, they are left in the `href` even they cannot be overwritten.\r\n\r\ne.g.\r\n```js\r\nvar url = new URL('http://user:pass@foo.bar.com:21/aaa/zzz?l=24#test');\r\nurl.protocol = 'file:';\r\n// url.href:\r\n// + expected: file://foo.bar.com/aaa/zzz?l=24#test\r\n// + actual: \"file://user:pass%40foo.bar.com:21/aaa/zzz?l=24#test\"\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/whatwg/url/issues/comments/282492576","html_url":"https://github.com/whatwg/url/issues/259#issuecomment-282492576","issue_url":"https://api.github.com/repos/whatwg/url/issues/259","id":282492576,"user":{"login":"watilde","id":1716463,"avatar_url":"https://avatars.githubusercontent.com/u/1716463?v=3","gravatar_id":"","url":"https://api.github.com/users/watilde","html_url":"https://github.com/watilde","followers_url":"https://api.github.com/users/watilde/followers","following_url":"https://api.github.com/users/watilde/following{/other_user}","gists_url":"https://api.github.com/users/watilde/gists{/gist_id}","starred_url":"https://api.github.com/users/watilde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/watilde/subscriptions","organizations_url":"https://api.github.com/users/watilde/orgs","repos_url":"https://api.github.com/users/watilde/repos","events_url":"https://api.github.com/users/watilde/events{/privacy}","received_events_url":"https://api.github.com/users/watilde/received_events","type":"User","site_admin":false},"created_at":"2017-02-25T15:54:39Z","updated_at":"2017-02-25T15:54:39Z","body":"I just noticed that `URL` allows adding an invalid URL into `href`:\r\n```js\r\nvar url = new URL('http://example.com');\r\nurl.href = 'file://user:pass%40foo.bar.com:21/aaa/zzz?l=24#test';\r\n```\r\nThen issue is not an exception anymore. Fair enough :)\r\n\r\nThanks, I'm going to close this as resolved."}}
{"actor":{"display_login":"watilde"}}