From aaa5ad278f516b5e2c8a9c209fe8a4807f70cb39 Mon Sep 17 00:00:00 2001 From: Uzlopak <5059100+Uzlopak@users.noreply.github.com> Date: Wed, 28 Aug 2024 00:15:42 +0000 Subject: [PATCH] chore: update WPT --- test/fixtures/wpt/xhr/request-content-length.any.js | 1 + test/fixtures/wpt/xhr/resources/echo-headers.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/test/fixtures/wpt/xhr/request-content-length.any.js b/test/fixtures/wpt/xhr/request-content-length.any.js index 054d2cce9d2..69a1e168365 100644 --- a/test/fixtures/wpt/xhr/request-content-length.any.js +++ b/test/fixtures/wpt/xhr/request-content-length.any.js @@ -11,6 +11,7 @@ async_test(test => { assert_true(happened); assert_true(client.responseText.includes(`Content-Length: ${data.length}`)); }); + client.onerror = test.unreached_func(); client.open("POST", "resources/echo-headers.py"); client.send(data); }, "Uploads need to set the Content-Length header"); diff --git a/test/fixtures/wpt/xhr/resources/echo-headers.py b/test/fixtures/wpt/xhr/resources/echo-headers.py index 58a7ed5637f..63943082b63 100644 --- a/test/fixtures/wpt/xhr/resources/echo-headers.py +++ b/test/fixtures/wpt/xhr/resources/echo-headers.py @@ -1,7 +1,9 @@ def main(request, response): + content = str(request.raw_headers) response.writer.write_status(200) response.writer.write_header(b"Content-Type", b"text/plain") + response.writer.write_header(b"Content-Length", str(len(content))) response.writer.write_header(b"Connection", b"close") response.writer.end_headers() - response.writer.write(str(request.raw_headers)) + response.writer.write(content) response.close_connection = True