Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ http_v02 = { package = "http", version = "0.2.9" }
httparse = "1.8.0"
hyper = { version = "1.6.0", features = ["full"] }
hyper-rustls = { version = "0.27.2", default-features = false, features = ["http1", "http2", "tls12", "aws-lc-rs"] }
hyper-util = { version = "0.1.10", features = ["tokio", "client", "client-legacy", "server", "server-auto"] }
hyper-util = { version = "0.1.17", features = ["tokio", "client", "client-legacy", "server", "server-auto"] }
hyper_v014 = { package = "hyper", version = "0.14.26", features = ["runtime", "http1"] }
idna = "1.0.3"
ignore = "0.4"
Expand Down
5 changes: 5 additions & 0 deletions tests/specs/run/all_proxy/__test__.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"if": "linux",
"args": "run -A --unstable-vsock test.ts",
"output": "test.out"
}
8 changes: 8 additions & 0 deletions tests/specs/run/all_proxy/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
async function test(url) {
const res = await fetch(url);
console.log(res);
console.log(await res.text());
}

await test("http://insecure.invalid");
await test("https://secure.invalid");
33 changes: 33 additions & 0 deletions tests/specs/run/all_proxy/test.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Listening on vsock:4294967295:1234567
Response {
body: ReadableStream { locked: false },
bodyUsed: false,
headers: Headers {
"content-length": "24",
"content-type": "text/plain;charset=UTF-8",
date: "[WILDCARD]",
vary: "Accept-Encoding"
},
ok: true,
redirected: false,
status: 200,
statusText: "OK",
url: "http://insecure.invalid/"
}
http://insecure.invalid/
Response {
body: ReadableStream { locked: false },
bodyUsed: false,
headers: Headers {
"content-length": "23",
"content-type": "text/plain;charset=UTF-8",
date: "[WILDCARD]",
vary: "Accept-Encoding"
},
ok: true,
redirected: false,
status: 200,
statusText: "OK",
url: "https://secure.invalid/"
}
https://secure.invalid/
16 changes: 16 additions & 0 deletions tests/specs/run/all_proxy/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
await using server = Deno.serve({
transport: "vsock",
cid: -1,
port: 1234567,
}, (req) => {
return new Response(req.url);
});

await new Deno.Command(Deno.execPath(), {
args: ["run", "-A", "client.ts"],
env: {
"ALL_PROXY": "vsock:1:1234567",
},
stderr: "inherit",
stdout: "inherit",
}).output();
3 changes: 1 addition & 2 deletions tests/unit/fetch_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2364,8 +2364,7 @@ Deno.test(
const resp1 = await fetch("https://example.com/ping", { client });
assertEquals(resp1.status, 200);
assertEquals(resp1.headers.get("content-type"), "text/plain");
// TODO(@lucacasonato): should be https://example.com/ping. bug in https://github.com/hyperium/hyper-util/blob/00035bac2da1cfa820eda4db7bf7ddcbd30be3c1/src/client/legacy/client.rs#L915-L917
assertEquals(await resp1.text(), "http://example.com/ping");
assertEquals(await resp1.text(), "https://example.com/ping");

const resp2 = await fetch("http://localhost:42424/ping", { client });
assertEquals(resp2.status, 200);
Expand Down
Loading