diff options
author | David Faure <david.faure@kdab.com> | 2016-07-28 12:25:59 +0200 |
---|---|---|
committer | David Faure <david.faure@kdab.com> | 2016-07-29 17:51:51 +0000 |
commit | 8a33077853e851e2795476cd502444c2d8535f9a (patch) | |
tree | 4a33e4af0e3d4ef5c9f138d1af545461cb1049ba /src/corelib/io | |
parent | 8141d64527c5e7a1723e2caeeebb0cde4e591207 (diff) |
QUrl: fix resolved() for data URLs
They look relative because the path doesn't start with a '/' but they
have a scheme so they shouldn't be combined as if it was one absolute
and one relative URL.
[ChangeLog][QtCore][QUrl] QUrl::resolved() no longer treats a URL with
a scheme as a relative URL if it matches this URL's scheme. This special
casing was incompatible with RFC 3986 and broke resolving data: URLs,
for instance.
Change-Id: I3758d3a2141cea7c6d13514243eb8dee5d510dd0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qurl.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 2672de24f2..1fe529d48d 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -3167,8 +3167,7 @@ QUrl QUrl::resolved(const QUrl &relative) const if (!relative.d) return *this; QUrl t; - // be non strict and allow scheme in relative url - if (!relative.d->scheme.isEmpty() && relative.d->scheme != d->scheme) { + if (!relative.d->scheme.isEmpty()) { t = relative; t.detach(); } else { |