[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdelibs/kioslave/http
From: Ralf Hoelzer <ralf () well ! com>
Date: 2004-04-27 18:35:23
Message-ID: 20040427183523.140659A5E () office ! kde ! org
[Download RAW message or body]
CVS commit by rhoezler:
Fix for bug #71751. Set mime-type to text/html, if the server response contains
no headers and starts directly with a html/xml tag.
M +14 -8 http.cc 1.612
--- kdelibs/kioslave/http/http.cc #1.611:1.612
@@ -2652,4 +2652,18 @@ bool HTTPProtocol::readHeader()
buf++;
+
+ if (buf[0] == '<')
+ {
+ // We get XML / HTTP without a proper header
+ // put string back
+ kdDebug(7103) << "kio_http: No valid HTTP header found! Document starts with \
XML/HTML tag" << endl; +
+ // Document starts with a tag, assume html instead of text/plain
+ m_strMimeType = "text/html";
+
+ rewind();
+ break;
+ }
+
// Store the the headers so they can be passed to the
// calling application later
@@ -3213,12 +3227,4 @@ bool HTTPProtocol::readHeader()
break;
}
- else if (buf[0] == '<')
- {
- // We get XML / HTTP without a proper header
- // put string back
- rewind();
- break;
- }
-
setRewindMarker();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic