From kde-commits Tue Jan 25 11:12:36 2011 From: Dawit Alemayehu Date: Tue, 25 Jan 2011 11:12:36 +0000 To: kde-commits Subject: KDE/kdelibs/kioslave/http Message-Id: <20110125111236.76F6CAC8B9 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=129595401127261 SVN commit 1216992 by adawit: Added mime-type fix for video/webm being sent as text/plain M +8 -6 http.cpp --- trunk/KDE/kdelibs/kioslave/http/http.cpp #1216991:1216992 @@ -2632,17 +2632,19 @@ // Some webservers say "text/plain" when they mean "application/x-bzip" else if ((m_mimeType == QLatin1String("text/plain")) || (m_mimeType == QLatin1String("application/octet-stream"))) { - QString ext = m_request.url.path().right(4).toUpper(); - if (ext == QLatin1String(".BZ2")) + const QString ext = QFileInfo(m_request.url.path()).suffix().toUpper(); + if (ext == QLatin1String("BZ2")) m_mimeType = QLatin1String("application/x-bzip"); - else if (ext == QLatin1String(".PEM")) + else if (ext == QLatin1String("PEM")) m_mimeType = QLatin1String("application/x-x509-ca-cert"); - else if (ext == QLatin1String(".SWF")) + else if (ext == QLatin1String("SWF")) m_mimeType = QLatin1String("application/x-shockwave-flash"); - else if (ext == QLatin1String(".PLS")) + else if (ext == QLatin1String("PLS")) m_mimeType = QLatin1String("audio/x-scpls"); - else if (ext == QLatin1String(".WMV")) + else if (ext == QLatin1String("WMV")) m_mimeType = QLatin1String("video/x-ms-wmv"); + else if (ext == QLatin1String("WEBM")) + m_mimeType = QLatin1String("video/webm"); } kDebug(7113) << "after fixup" << m_mimeType; }