Bug 169556

Summary: Garbage instead of html rendering at www.idealista.com
Product: [Frameworks and Libraries] kio Reporter: Raúl <rasasi78>
Component: httpAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: aikurn, andresbajotierra, maksim, rasasi78, zahl
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Rendering and document information (http headers)

Description Raúl 2008-08-21 23:51:07 UTC
Version:           3.5.9 (using 3.5.9, Debian Package 4:3.5.9.dfsg.1-6 (lenny/sid))
Compiler:          Target: x86_64-linux-gnu
OS:                Linux (x86_64) release 2.6.26-toi-rc7

Tested on konqueror 3.5.9 and 4.1. When you go to www.idealista.com you are redirected automatically to http://www.idealista.com/pagina/portada where you can only see garbage: no text, no images. Same as if you were looking at a binary file.

Regards,
Comment 1 Raúl 2008-08-21 23:53:38 UTC
Forgot to say working on iceweasel/firefox 3.0 and on arora/webkit
Comment 2 A. Spehr 2008-08-22 10:57:28 UTC
Hmm.... It's currently refusing connections.
Comment 3 Leticia Hernández 2008-08-22 13:28:48 UTC
I'm seeing garbage too with 4.1.62. I've switched the View Mode to Kate and saved the file as idealista.html. If I open this file with Konqueror I can see a proper page, not garbage.
Comment 4 Dario Andres 2008-08-22 14:57:04 UTC
Using KDE 4.1.1 (KDE 4.1.0 (4.1 >= 20080722)) (KDEmod) in ArchLinux i686:
I can reproduce this bug
Comment 5 Dario Andres 2008-08-22 14:57:57 UTC
Created attachment 26983 [details]
Rendering and document information (http headers)
Comment 6 Maksim Orlovich 2008-08-22 18:45:32 UTC
The problem is that the parser in kio_http's HTTPProtocol::readResponseHeader() 
seems to somehow decide that the (likely bogus) HTTP-Version: header is a new response type, and that it gets an invalid HTTP version, which makes it ignore the Transfer-Encoding: header.

--- http.cpp    (revision 847182)
+++ http.cpp    (working copy)
@@ -2745,7 +2745,7 @@
     // calling application later
     m_responseHeaders << QString::fromLatin1(buf);

-    if ((strncasecmp(buf, "HTTP", 4) == 0) ||
+    if ((strncasecmp(buf, "HTTP/", 5) == 0) ||
         (strncasecmp(buf, "ICY ", 4) == 0)) // Shoutcast support
     {
       if (strncasecmp(buf, "ICY ", 4) == 0)

makes it work, and is certainly justifiable but really, the code sucks,
so it may make sense to put this into 4.1.x only or something.


Comment 7 Maksim Orlovich 2008-09-12 02:48:49 UTC
The above fix committed to 4.1 branch in r860101. trunk has a significant 
rework of response/header parsing which doesn't suffer from the issue.