Bug 295305 - Cannot log into OpenWRT due to strange Content-Type header
Summary: Cannot log into OpenWRT due to strange Content-Type header
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: 4.8.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-04 15:43 UTC by Alexander Patrakov
Modified: 2012-03-12 07:57 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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