Re: URLs

On 2012-06-15 14:52, Anne van Kesteren wrote:
> On Fri, Jun 15, 2012 at 2:45 PM, Julian Reschke <julian.reschke@gmx.de> wrote:
>> On 2012-06-15 14:06, Anne van Kesteren wrote:
>>> http://wiki.whatwg.org/wiki/URL#Parsing
>>
>> Quoting:
>>
>> "if url.scheme is not hierarchical  (data:)"
>>
>> How do you test that?
>
> Whitelist.

Sounds like something to avoid.

>> And, again: what's wrong with
>> <http://greenbytes.de/tech/webdav/rfc3986.html#rfc.section.B>? I can imagine
>> it doesn't do everything you want (in which case, start by documenting what
>> you think needs to be fixed), but it seems to be a much much better starting
>> point than what you have.
>
> Not sure. How does that handle parsing "http:test" with a base URL
> whose scheme is http and host is example.org? Or against no base URL?

You are confusing parsing a URI and resolving it.

"http:test" parses as a URI with a scheme of "http" and a path of "test".

Resolving "http:test" against "http://example.org/foobar" yields 
"http:test".

Of course you can't use "http:test" to fetch something over HTTP, so you 
could apply heuristics to "fix" the URI. But that has nothing to do with 
*parsing*.

To resolve a URI, you need a base URI.

 > (Serialized result has to be http://example.org/test and http://test/
 > respectively.)
> ...
>> Also: I thought this is now a webapps WG deliverable? Why post over here?
>
> Did not think it was worth it to bother all of public-webapps with
> some basic questions as to how to approach specifying URLs.

It seems that we disagree on what a WG is for, then :-)

Best regards, Julian

Received on Friday, 15 June 2012 13:11:40 UTC