WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
63696
Custom Accept-Encoding header prevents autoDecompress
https://bugs.webkit.org/show_bug.cgi?id=63696
Summary
Custom Accept-Encoding header prevents autoDecompress
Thijs
Reported
2011-06-30 02:40:21 PDT
When you set a custom "Accept-Encoding" raw header on a QNetworkRequest object (for example via an overridden QNetworkAccessManager::createRequest() ), QtWebKit will never decompress the reply anymore: source code of qhttpnetworkconnection.cpp : ==================== value = request.headerField("accept-encoding"); if (value.isEmpty()) { #ifndef QT_NO_COMPRESS request.setHeaderField("Accept-Encoding", "gzip"); request.d->autoDecompress = true; #else // if zlib is not available set this to false always request.d->autoDecompress = false; #endif } ==================== If the "accept-encoding" header was already set, request.d->autoDecompress is never set to true. This is even true if you manually set the header to "gzip" for example. The solution consists of two parts: 1) If the current value contains "gzip", also set autoDecompress to true 2) add a custom method to manually set autoDecompress to true (useful if you do not want gzipped data, but if the server still sends it, then decode it anyway as a fallback method)
Attachments
Add attachment
proposed patch, testcase, etc.
Markus Goetz
Comment 1
2011-06-30 02:59:37 PDT
That's not a bug. If you set the header on the QNetworkRequest you are basically telling QNetworkAccessManager "I know what I'm doing, please don't do any content encoding processing".
Thijs
Comment 2
2011-06-30 03:13:17 PDT
(In reply to
comment #1
)
> That's not a bug. If you set the header on the QNetworkRequest you are basically telling QNetworkAccessManager "I know what I'm doing, please don't do any content encoding processing".
If that's true, then the documentation should clearly point this out. It doesn't mention anywhere that if you set the Accept-Encoding manually, you will not get auto-decompression anymore. Especially if you set "gzip" (same as Qt does), this is very surprising.
Thijs
Comment 3
2011-06-30 04:39:33 PDT
Changed from "bug" to "enhancement" request
Alexey Proskuryakov
Comment 4
2022-07-29 10:53:33 PDT
The Qt port has been removed from WebKit, resolving this bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug