зеркало из https://github.com/mozilla/pjs.git
Make us handle type:application/x-gunzip, encoding:gzip. Bug 128177,
r=bbaetz, sr=darin, a=shaver
This commit is contained in:
Родитель
48b7bc0ad5
Коммит
1521a3a702
|
@ -60,6 +60,7 @@
|
|||
#define APPLICATION_FORTEZZA_KRL "application/x-fortezza-krl"
|
||||
#define APPLICATION_GZIP "application/x-gzip"
|
||||
#define APPLICATION_GZIP2 "application/gzip"
|
||||
#define APPLICATION_GZIP3 "application/x-gunzip"
|
||||
#define APPLICATION_HTTP_INDEX_FORMAT "application/http-index-format"
|
||||
#define APPLICATION_JAVASCRIPT "application/x-javascript"
|
||||
#define APPLICATION_NETSCAPE_REVOCATION "application/x-netscape-revocation"
|
||||
|
|
|
@ -566,13 +566,22 @@ nsHttpChannel::ProcessNormal()
|
|||
// as well as Content-Encoding: gzip, which is completely wrong. In
|
||||
// this case, we choose to ignore the rogue Content-Encoding header. We
|
||||
// must do this early on so as to prevent it from being seen up stream.
|
||||
// The same problem exists for Content-Encoding: compress in default
|
||||
// Apache installs.
|
||||
const char *encoding = mResponseHead->PeekHeader(nsHttp::Content_Encoding);
|
||||
if (encoding && PL_strcasestr(encoding, "gzip") && (
|
||||
!PL_strcmp(mResponseHead->ContentType(), APPLICATION_GZIP) ||
|
||||
!PL_strcmp(mResponseHead->ContentType(), APPLICATION_GZIP2))) {
|
||||
!PL_strcmp(mResponseHead->ContentType(), APPLICATION_GZIP2) ||
|
||||
!PL_strcmp(mResponseHead->ContentType(), APPLICATION_GZIP3))) {
|
||||
// clear the Content-Encoding header
|
||||
mResponseHead->SetHeader(nsHttp::Content_Encoding, nsnull);
|
||||
}
|
||||
else if (encoding && PL_strcasestr(encoding, "compress") && (
|
||||
!PL_strcmp(mResponseHead->ContentType(), APPLICATION_COMPRESS) ||
|
||||
!PL_strcmp(mResponseHead->ContentType(), APPLICATION_COMPRESS2))) {
|
||||
// clear the Content-Encoding header
|
||||
mResponseHead->SetHeader(nsHttp::Content_Encoding, nsnull);
|
||||
}
|
||||
|
||||
// this must be called before firing OnStartRequest, since http clients,
|
||||
// such as imagelib, expect our cache entry to already have the correct
|
||||
|
|
Загрузка…
Ссылка в новой задаче