From df06926b8a25316db5c21a82e68beb097999e7b2 Mon Sep 17 00:00:00 2001 From: David Faure Date: Sat, 25 Feb 2017 11:56:12 +0100 Subject: QMimeDatabase::mimeTypeForUrl: skip content check for remote URLs The code was trying to open a local file with the same path as the remote URL, which is unnecessary and wrong in the unlikely case where such a file would exist. Spotted by Christoph Feck when reading the code. Change-Id: I1d77e5781cf606b025d2877f48a9914dd1e36b1d Reviewed-by: Giuseppe D'Angelo --- src/corelib/mimetypes/qmimedatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/mimetypes') diff --git a/src/corelib/mimetypes/qmimedatabase.cpp b/src/corelib/mimetypes/qmimedatabase.cpp index fda9f01643..687f0b3e03 100644 --- a/src/corelib/mimetypes/qmimedatabase.cpp +++ b/src/corelib/mimetypes/qmimedatabase.cpp @@ -526,7 +526,7 @@ QMimeType QMimeDatabase::mimeTypeForUrl(const QUrl &url) const if (scheme.startsWith(QLatin1String("http")) || scheme == QLatin1String("mailto")) return mimeTypeForName(d->defaultMimeType()); - return mimeTypeForFile(url.path()); + return mimeTypeForFile(url.path(), MatchExtension); } /*! -- cgit v1.2.3