bug 1211916 - rename brotli http coding to br r=bagder

This commit is contained in:
Patrick McManus 2015-10-06 11:03:50 -04:00
parent 295fd4fa05
commit 0793f32151
5 changed files with 9 additions and 9 deletions

View File

@ -1326,7 +1326,7 @@ pref("network.http.redirection-limit", 20);
// NOTE: support for "compress" has been disabled per bug 196406.
// NOTE: separate values with comma+space (", "): see bug 576033
pref("network.http.accept-encoding", "gzip, deflate");
pref("network.http.accept-encoding.secure", "gzip, deflate, brotli");
pref("network.http.accept-encoding.secure", "gzip, deflate, br");
pref("network.http.pipelining" , false);
pref("network.http.pipelining.ssl" , false); // disable pipelining over SSL

View File

@ -443,7 +443,7 @@ nsresult NS_NewStreamConv(nsStreamConverterService **aStreamConv);
#define UNKNOWN_CONTENT "?from=" UNKNOWN_CONTENT_TYPE "&to=*/*"
#define GZIP_TO_UNCOMPRESSED "?from=gzip&to=uncompressed"
#define XGZIP_TO_UNCOMPRESSED "?from=x-gzip&to=uncompressed"
#define BROTLI_TO_UNCOMPRESSED "?from=brotli&to=uncompressed"
#define BROTLI_TO_UNCOMPRESSED "?from=br&to=uncompressed"
#define COMPRESS_TO_UNCOMPRESSED "?from=compress&to=uncompressed"
#define XCOMPRESS_TO_UNCOMPRESSED "?from=x-compress&to=uncompressed"
#define DEFLATE_TO_UNCOMPRESSED "?from=deflate&to=uncompressed"

View File

@ -894,7 +894,7 @@ HttpBaseChannel::DoApplyContentConversions(nsIStreamListener* aNextListener,
mode = 1;
} else if (from.Equals("deflate") || from.Equals("x-deflate")) {
mode = 2;
} else if (from.Equals("brotli")) {
} else if (from.Equals("br")) {
mode = 3;
}
Telemetry::Accumulate(Telemetry::HTTP_CONTENT_ENCODING, mode);
@ -1005,7 +1005,7 @@ HttpBaseChannel::nsContentEncodings::GetNext(nsACString& aNextEncoding)
if (!haveType) {
encoding.BeginReading(start);
if (CaseInsensitiveFindInReadable(NS_LITERAL_CSTRING("brotli"), start, end)) {
if (CaseInsensitiveFindInReadable(NS_LITERAL_CSTRING("br"), start, end)) {
aNextEncoding.AssignLiteral(APPLICATION_BROTLI);
haveType = true;
}

View File

@ -34,7 +34,7 @@ class nsIStringInputStream;
#define HTTP_X_GZIP_TYPE "x-gzip"
#define HTTP_COMPRESS_TYPE "compress"
#define HTTP_X_COMPRESS_TYPE "x-compress"
#define HTTP_BROTLI_TYPE "brotli"
#define HTTP_BROTLI_TYPE "br"
#define HTTP_IDENTITY_TYPE "identity"
#define HTTP_UNCOMPRESSED_TYPE "uncompressed"

View File

@ -27,7 +27,7 @@ var tests = [
{url: "/test/cebrotli1",
flags: CL_EXPECT_GZIP,
ce: "brotli",
ce: "br",
body: [0x0B, 0x02, 0x80, 0x74, 0x65, 0x73, 0x74, 0x0A, 0x03],
datalen: 5 // the data length of the uncompressed document
@ -36,7 +36,7 @@ var tests = [
// this is not a brotli document
{url: "/test/cebrotli2",
flags: CL_EXPECT_GZIP | CL_EXPECT_FAILURE,
ce: "brotli",
ce: "br",
body: [0x0B, 0x0A, 0x09],
datalen: 3
},
@ -44,7 +44,7 @@ var tests = [
// this is brotli but should come through as identity due to prefs
{url: "/test/cebrotli3",
flags: 0,
ce: "brotli",
ce: "br",
body: [0x0B, 0x02, 0x80, 0x74, 0x65, 0x73, 0x74, 0x0A, 0x03],
datalen: 9
@ -92,7 +92,7 @@ var cePref;
function run_test() {
prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
cePref = prefs.getCharPref("network.http.accept-encoding");
prefs.setCharPref("network.http.accept-encoding", "gzip, deflate, brotli");
prefs.setCharPref("network.http.accept-encoding", "gzip, deflate, br");
httpserver.registerPathHandler("/test/cegzip1", handler);
httpserver.registerPathHandler("/test/cegzip2", handler);