On Friday, 19 de August de 2011 14:49:07 David Faure wrote:
> > > >         QUrl("/tmp/Mambo #5.mp3")
> > > > 
> > > > Is that:
> > > >         path() = "/tmp/Mambo ", fragment() = "5.mp3"
> > > > 
> > > > or      path() = "/tmp/Mambo #5.mp3"
> > > 
> > > Obviously the latter, since it starts with a '/', so it's not an
> > > absolute
> > > URL.
> > 
> > It is a valid, absolute URL with an empty scheme and empty authority. So
> > you cannot exclude it.
> 
> Sounds like an RFC point of view. For any practical purposes, a URL without
> a scheme is not absolute - you don't know how to get that data.

I've just reread the RFC 3986.

It makes a distinction between "URI" and "URI reference". A URI must have a 
scheme, whereas the "URI reference" is either the absolute URI or a relative 
reference. The RFC also says that the most common representation is the "URI 
reference".

> > The case of having to parse it is very common: the string comes from a
> > webpage or script and the web engine code needs to decide whether it is
> > cross-domain scripting or not. So it needs to treat the string as a URL.
> > 
> > If that string is "/foo", it is clearly meant as relative to the current
> > webpage. If we interpret that as "file:/foo", then the code might conclude
> > it is a cross-domain scripting.
> 
> Isn't the solution to resolve the URL first, and then compare it with the
> current domain?

Maybe, but we still need code to parse the string and break it down into the 
components (all except scheme).

> > > dxOffEagle3.setEncodedUrl( "http://something/newpage.html?[{\"foo:
> > > bar\"}]", QUrl::TolerantMode);

> That's what I was saying: as long as the tolerant parser is really tolerant
> with things that are NOT ambiguous (even if they are not encoded enough to
> be RFC-compliant), I agree with not having a distinction between encoded
> and non- encoded urls in the API.

The RFC says which characters are allowed, but we can accept non-allowed 
characters provided that they aren't otherwise reserved.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Qt5-feedback mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback

Reply via email to