зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1783567 - test case, r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D153940
This commit is contained in:
Родитель
8104b43b79
Коммит
ca7f73fc07
|
@ -684,6 +684,12 @@ function test_http2_post() {
|
|||
do_post(posts[0], chan, listener, "POST");
|
||||
}
|
||||
|
||||
function test_http2_empty_post() {
|
||||
var chan = makeChan("https://localhost:" + serverPort + "/post");
|
||||
var listener = new Http2PostListener("0");
|
||||
do_post("", chan, listener, "POST");
|
||||
}
|
||||
|
||||
// Make sure we can do a simple PATCH
|
||||
function test_http2_patch() {
|
||||
var chan = makeChan("https://localhost:" + serverPort + "/patch");
|
||||
|
@ -1319,6 +1325,7 @@ var tests = [
|
|||
test_http2_big,
|
||||
test_http2_huge_suspended,
|
||||
test_http2_post,
|
||||
test_http2_empty_post,
|
||||
test_http2_patch,
|
||||
test_http2_pushapi_1,
|
||||
test_http2_continuations,
|
||||
|
|
|
@ -719,11 +719,13 @@ function handleRequest(req, res) {
|
|||
}
|
||||
|
||||
var post_hash = crypto.createHash("md5");
|
||||
var received_data = false;
|
||||
req.on("data", function receivePostData(chunk) {
|
||||
received_data = true;
|
||||
post_hash.update(chunk.toString());
|
||||
});
|
||||
req.on("end", function finishPost() {
|
||||
let md5 = post_hash.digest("hex");
|
||||
let md5 = received_data ? post_hash.digest("hex") : "0";
|
||||
res.setHeader("X-Calculated-MD5", md5);
|
||||
res.writeHead(200);
|
||||
res.end(content);
|
||||
|
|
Загрузка…
Ссылка в новой задаче