mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-15 04:43:41 +00:00
feat: HTTP add TLS fingerprint fallback (#1444)
This commit is contained in:
68 files changed
+7243
-1604
No files matched your search
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
// META: global=window,worker
|
||||
|
||||
promise_test(async () => {
|
||||
const stream = new ReadableStream({
|
||||
start(controller) {
|
||||
controller.enqueue(new TextEncoder().encode("hello"));
|
||||
controller.close();
|
||||
}
|
||||
});
|
||||
|
||||
const r1 = new Request("https://example.com/", { method: "POST", body: stream, duplex: "half" });
|
||||
const r2 = r1.clone();
|
||||
assert_false(r2.bodyUsed, "clone should not be marked as used");
|
||||
assert_not_equals(r2.body, null, "clone should have a body");
|
||||
|
||||
// Constructing a new Request from the clone should preserve the body.
|
||||
const r3 = new Request(r2);
|
||||
assert_not_equals(r3.body, null, "Request constructed from clone should have a body");
|
||||
|
||||
const text = await r3.text();
|
||||
assert_equals(text, "hello", "body content should be preserved through clone() and new Request()");
|
||||
}, "new Request(clone) preserves a ReadableStream body that came from clone()");
|
||||
Reference in new issue
Block a user