From 8f950c4a5e2c223b622632402f65c2785ca02754 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 02:50:08 +0200 Subject: [PATCH] chore: update WPT (#3519) Co-authored-by: Uzlopak <5059100+Uzlopak@users.noreply.github.com> --- 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