[whatwg/url] username/password/port should be removed when "file" is added as scheme (#259)

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.

e.g.
```js
var url = new URL('http://user:pass@foo.bar.com:21/aaa/zzz?l=24#test');
url.protocol = 'file:';
// url.href:
// + expected: file://foo.bar.com/aaa/zzz?l=24#test
// + actual: "file://user:pass%40foo.bar.com:21/aaa/zzz?l=24#test"
```


-- 
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/259

Received on Thursday, 23 February 2017 21:20:49 UTC