On 18 November 2015 at 07:10, Paul Moore
On 17 November 2015 at 17:32, Robert Collins
wrote: The only place where URIs are used seem to be the "urlspec" rule, and probably you can accept any opaque string there.
Uhm, why are you making this suggestion? What problem will we solve by using a proxy rule?
I think the point here is syntax vs semantics. It is simpler to parse if we make the *syntax* state that an opaque string is allowed here. The *semantics* can then say that the string is to be handled as a URL, meaning that any string that isn't a valid URL will fail when we try to pass it to urllib or whatever.
The only advantage of *parsing* it as a URL is that we get to reject foo::::/bar:baz as a syntax error. But we'd still reject foo:/bar as an invalid URL (unknown protocol) later in the processing, so why bother trying to trap the specific error of "doesn't look like a URL" early?
By including the URL syntax, we're mandating that conforming implementations *have* to trap malformed URLs early, and can't defer that validation to the URL library being used to process the URL.
I don't understand how we're mandating that.
-Rob
--
Robert Collins