Bug 1871963: Implement zstd content-encoding support r=necko-reviewers,valentin,devtools-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D205109
This commit is contained in:
Randell Jesup
2024-04-09 15:26:46 +00:00
parent b94f7b1cd1
commit c7ddeb74ea
10 changed files with 146 additions and 8 deletions

View File

@@ -1539,6 +1539,8 @@ HttpBaseChannel::DoApplyContentConversions(nsIStreamListener* aNextListener,
mode = 2;
} else if (from.EqualsLiteral("br")) {
mode = 3;
} else if (from.EqualsLiteral("zstd")) {
mode = 4;
}
Telemetry::Accumulate(Telemetry::HTTP_CONTENT_ENCODING, mode);
}
@@ -1643,6 +1645,14 @@ HttpBaseChannel::nsContentEncodings::GetNext(nsACString& aNextEncoding) {
}
}
if (!haveType) {
encoding.BeginReading(start);
if (CaseInsensitiveFindInReadable("zstd"_ns, start, end)) {
aNextEncoding.AssignLiteral(APPLICATION_ZSTD);
haveType = true;
}
}
// Prepare to fetch the next encoding
mCurEnd = mCurStart;
mReady = false;