datalen: 5, // the data length of the uncompressed document
},
// this is a truncated brotli document, producing no output bytes
{
url: "/test/cebrotli2",
flags: CL_EXPECT_GZIP,
ce: "br",
body: [0x0b, 0x0a, 0x09],
datalen: 0,
},
// this is brotli but should come through as identity due to prefs
{
url: "/test/cebrotli3",
flags: 0,
ce: "br",
body: [0x0b, 0x02, 0x80, 0x74, 0x65, 0x73, 0x74, 0x0a, 0x03],
datalen: 9,
},
// this is not a brotli document
{
url: "/test/cebrotli4",
flags: CL_EXPECT_GZIP | CL_EXPECT_FAILURE,
ce: "br",
body: [ 0x01, 0xe6, 0x00, 0x76, 0x42, 0x10, 0x01, 0x1c, 0x24, 0x24, 0x3c, 0xd7, 0xd7, 0xd7, 0x01, 0x1c,
],
datalen: 16,
},
// this is a brotli document
{
url: "/test/cebrotli5",
flags: CL_EXPECT_GZIP,
ce: "br",
body: [0x0b, 0x00, 0x80, 0x4e, 0x03],
datalen: 1,
},
// this a truncated brotli document (missing the end marker) // producing one output byte
{
url: "/test/cebrotli6",
flags: CL_EXPECT_GZIP,
ce: "br",
body: [0x0b, 0x00, 0x80, 0x4e],
datalen: 1,
},
];
function startIter() { if (tests[index].url === "/test/cebrotli3") { // this test wants to make sure we don't do brotli when not in a-e
prefs.setCharPref("network.http.accept-encoding", "gzip, deflate");
} else {
prefs.setCharPref("network.http.accept-encoding", "gzip, deflate, br");
} var channel = setupChannel(tests[index].url);
channel.asyncOpen( new ChannelListener(completeIter, channel, tests[index].flags)
);
}
function completeIter(request, data) { if (!(tests[index].flags & CL_EXPECT_FAILURE)) { Assert.equal(data.length, tests[index].datalen, "test " + index);
} if (++index < tests.length) {
startIter();
} else {
httpserver.stop(do_test_finished);
prefs.setCharPref("network.http.accept-encoding", cePref);
}
}
var prefs; var cePref; function run_test() {
prefs = Services.prefs;
cePref = prefs.getCharPref("network.http.accept-encoding");
prefs.setBoolPref("network.http.encoding.trustworthy_is_https", false);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.