summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2017-10-17 15:16:40 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2017-10-19 12:51:38 +0000
commitfc988786588bf86ebc46fdd12629efbec8ae1841 (patch)
treee9e7282ae40db56e6dd0c477dfa561701ceca79d /src/network
parentf13e75345d035ec906846aaa3540454787edbd3f (diff)
Fix cookie path matching for empty url path
The path wouldn't match if the cookie's path was root ('/') and the URLs path was empty. Change-Id: I6dcd10f1fdf4f48f14e50f1b169cbdfda7005849 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qnetworkcookiejar.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/access/qnetworkcookiejar.cpp b/src/network/access/qnetworkcookiejar.cpp
index 232c2b47a5..f62a03b11d 100644
--- a/src/network/access/qnetworkcookiejar.cpp
+++ b/src/network/access/qnetworkcookiejar.cpp
@@ -140,7 +140,7 @@ void QNetworkCookieJar::setAllCookies(const QList<QNetworkCookie> &cookieList)
static inline bool isParentPath(const QString &path, const QString &reference)
{
- if (path.startsWith(reference)) {
+ if ((path.isEmpty() && reference == QLatin1String("/")) || path.startsWith(reference)) {
//The cookie-path and the request-path are identical.
if (path.length() == reference.length())
return true;