Bug 295305

Summary: Cannot log into OpenWRT due to strange Content-Type header
Product: [Applications] konqueror Reporter: Alexander Patrakov <patrakov>
Component: generalAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: aiacovitti
Priority: NOR    
Version: 4.8.0   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 4.8.2
Sentry Crash Report:

Description Alexander Patrakov 2012-03-04 15:43:23 UTC
When POSTing forms, Konqueror sends the Content-Type header as follows:

Content-Type:application/x-www-form-urlencoded

Note the lack of the space character between ":" and "a". Due to the lack of this space, it is impossible to log into OpenWRT-based wireless routers using Konqueror. This has been reported as https://dev.openwrt.org/ticket/11079
Comment 1 Andrea Iacovitti 2012-03-04 20:16:23 UTC
Could you try this patch and see if the problem is fixed?

--- kioslave/http/http.cpp
+++ kioslave/http/http.cpp
@@ -2625,8 +2625,8 @@
     if (!contentType.isEmpty())
     {
       if (!contentType.startsWith(QLatin1String("content-type"), Qt::CaseInsensitive))
-        header += QLatin1String("Content-Type:");
-      header += contentType;
+        header += QLatin1String("Content-Type: ");
+      header += contentType.trimmed();
       header += QLatin1String("\r\n");
     }
Comment 2 Andrea Iacovitti 2012-03-12 07:57:27 UTC
Git commit 5bc91690dff7c3608d3ca2cb285140a86002f4ca by Andrea Iacovitti.
Committed on 12/03/2012 at 08:53.
Pushed by aiacovitti into branch 'KDE/4.8'.

Make sure there is a whitespace after the colon in Content-Type http header
FIXED-IN: 4.8.2
REVIEW: 104221

M  +1    -1    kioslave/http/http.cpp

http://commits.kde.org/kdelibs/5bc91690dff7c3608d3ca2cb285140a86002f4ca