On 10/29/14 5:55 PM, Valentin Gosu wrote:
On 30 October 2014 02:47, Sam Ruby <[email protected] <mailto:[email protected]>> wrote:On 10/29/14 5:39 PM, Valentin Gosu wrote: On 29 October 2014 15:34, Sam Ruby <[email protected] <mailto:[email protected]> <mailto:[email protected] <mailto:[email protected]>__>> wrote: On 10/29/14 6:09 AM, Valentin Gosu wrote: I think the content at http://intertwingly.net/____projects/pegurl/url.html <http://intertwingly.net/__projects/pegurl/url.html> <http://intertwingly.net/__projects/pegurl/url.html <http://intertwingly.net/projects/pegurl/url.html>> would represent a nice addition to https://url.spec.whatwg.org/, but can't really replace the parsing steps we already have. Care to explain why? Those steps represent an important reference for implementers, handling corner cases and parsing peculiarities that might not be obvious at first glance. While they're not crucial to the spec, they have been really useful so far, and I'd like them to continue being available. My assertion is that the steps I have provided cover these exact same corner cases and parsing peculiarities, and I have running code and published test results to back up my assertion. Can you identify a single corner case that isn't covered (other than the encoding changes that I already have noted as todos in the document)? One I can think of is var url = new URL("http://localhost/"); url.host = "example.com:1234#hello <http://example.com:1234#hello>" //hostname = example.com <http://example.com>, port = 1234 or even url.host = "example.com:abcd" // hostname = example.com <http://example.com>, port = -1 The intertwingly implementation doesn't explicitly cover this case from what I can tell (althought the end result might be the same).
Todo added: https://github.com/rubys/url/commit/484bdec6a51ed7c7956f225ba5e8e28151ac1129 Thanks! Let me know if you spot anything else. - Sam Ruby
