[Qt-interest] QtWebKit content-type support
Joel A. Iturra P.
tortuguero at gmail.com
Tue Oct 27 20:53:01 CET 2009
Hi David,
Looking for one rapid solution, I do this "temporal patch" that it seems
to work.
File:
qt-x11-opensource-src-4.5.2/src/network/access/qnetworkrequest.cpp
Method:
void QNetworkHeadersPrivate::parseAndSetHeader(const QByteArray &key,
const QByteArray &value);
--- qt-x11-opensource-src-4.5.2/src/network/access/qnetworkrequest.cpp
2009-06-20 00:57:57.000000000 -0400
+++ qt-x11-opensource-src-4.5.2-atentus/src/network/access/qnetworkrequest.cpp
2009-10-27 12:30:10.000000000 -0300
@@ -757,7 +757,7 @@
if (value.isNull())
cookedHeaders.remove(parsedKey);
else
- cookedHeaders.insert(parsedKey,
parseHeaderValue(parsedKey, value));
+ cookedHeaders.insert(parsedKey,
parseHeaderValue(parsedKey, value.toLower()));
}
}
But I do not know if this can cause any bad behavior in other context.
How can I test or get help for this ?
thanks
Joel A. Iturra
On 10/27/09, David Boddie <david.boddie at nokia.com> wrote:
> Ingo Krabbe wrote:
>
>> On Mon, Oct 26, 2009 at 12:39:32PM -0300, Joel A. Iturra P. wrote:
>>> Hi everyone,
>>>
>>> Recently I found a client web page with wrong content-type ("text/HTML").
>>> This content-type is not recognize by QtWebKit.
>>>
>>> There is any "not too complicated" way to add this content-type and treat
>>> it like "text/html" ?
>>
>> I cannot find any documentation where the QtWebKit Module tries to detect
>> the content type. As far as I know are mime-types case insesitive. So I
>> would guess this a bug in the QtWebKit module or the surrounding software.
>
> I can't say if this is a bug in QtWebKit but, if you need to change the way
> content is loaded and recognized, you may want to look into creating a
> custom QNetworkAccessManager subclass and using an instance of that to
> handle network requests for QtWebKit.
>
> I thought I'd put a related example on the Qt Centre Wiki at
> http://wiki.qtcentre.org but apparently not. The closest thing I can find
> right now is this example:
>
> http://www.diotavelli.net/PyQtWiki/Using%20a%20Custom%20Protocol%20with%20QtWebKit
>
> This doesn't do anything with the content type, but it shows how to replace
> the standard QNetworkAccessManager with something else.
>
> David
> --
> David Boddie
> Senior Technical Writer
> Nokia, Qt Development Frameworks
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
--
Joel A. Iturra
Santiago - Chile
More information about the Qt-interest-old
mailing list