[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    =?utf-8?q?=5Bkdelibs=5D_kioslave/http=3A_Workaround_yet_another_?=
From:       Dawit Alemayehu <adawit () kde ! org>
Date:       2011-06-09 8:03:34
Message-ID: 20110609080334.8F12FA60A6 () git ! kde ! org
[Download RAW message or body]

Git commit bf3064cb42f51370f343a61041ac28f7cf81e3d7 by Dawit Alemayehu.
Committed on 09/06/2011 at 09:57.
Pushed by adawit into branch 'master'.

Workaround yet another broken server that sends the incorrect mime-type information.

This time it is the ArchLinux servers sending application/x-xz instead of
application/x-xz-compressed-tar when downloading packages.

BUG: 267345
FIXED-IN: 4.6.5

(cherry picked from commit 3332be75106b7d555e7a44a24875b0b5085821f1)

M  +9    -0    kioslave/http/http.cpp     

http://commits.kde.org/kdelibs/bf3064cb42f51370f343a61041ac28f7cf81e3d7

diff --git a/kioslave/http/http.cpp b/kioslave/http/http.cpp
index 7228309..dab115c 100644
--- a/kioslave/http/http.cpp
+++ b/kioslave/http/http.cpp
@@ -2653,6 +2653,15 @@ void HTTPProtocol::fixupResponseMimetype()
             m_mimeType = QLatin1String("application/x-gzpostscript");
     }
 
+    // Prefer application/x-xz-compressed-tar over application/x-xz for LMZA \
compressed +    // tar files. Arch Linux AUR servers notoriously send the wrong \
mimetype for this. +    else if(m_mimeType == QLatin1String("application/x-xz")) {
+        if (m_request.url.path().endsWith(QLatin1String(".tar.xz")) ||
+            m_request.url.path().endsWith(QLatin1String(".txz"))) {
+            m_mimeType = QLatin1String("application/x-xz-compressed-tar");
+        }
+    }
+
     // Some webservers say "text/plain" when they mean "application/x-bzip"
     else if ((m_mimeType == QLatin1String("text/plain")) || (m_mimeType == \
                QLatin1String("application/octet-stream"))) {
         const QString ext = QFileInfo(m_request.url.path()).suffix().toUpper();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic