mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -05:00
fix(ci): simplify test assertion for http version enforcing with Deno.createHttpClient (#19210)
This commit is contained in:
parent
6255cf4642
commit
addfb0c546
2 changed files with 11 additions and 14 deletions
|
@ -1532,34 +1532,24 @@ Deno.test(
|
||||||
);
|
);
|
||||||
|
|
||||||
Deno.test(
|
Deno.test(
|
||||||
{
|
{ permissions: { net: true, read: true } },
|
||||||
permissions: { net: true, read: true },
|
|
||||||
// Doesn't pass on linux CI for unknown reasons (works fine locally on linux)
|
|
||||||
ignore: Deno.build.os !== "darwin",
|
|
||||||
},
|
|
||||||
async function fetchForceHttp1OnHttp2Server() {
|
async function fetchForceHttp1OnHttp2Server() {
|
||||||
const client = Deno.createHttpClient({ http2: false, http1: true });
|
const client = Deno.createHttpClient({ http2: false, http1: true });
|
||||||
await assertRejects(
|
await assertRejects(
|
||||||
() => fetch("http://localhost:5549/http_version", { client }),
|
() => fetch("http://localhost:5549/http_version", { client }),
|
||||||
TypeError,
|
TypeError,
|
||||||
"invalid HTTP version parsed",
|
|
||||||
);
|
);
|
||||||
client.close();
|
client.close();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
Deno.test(
|
Deno.test(
|
||||||
{
|
{ permissions: { net: true, read: true } },
|
||||||
permissions: { net: true, read: true },
|
|
||||||
// Doesn't pass on linux CI for unknown reasons (works fine locally on linux)
|
|
||||||
ignore: Deno.build.os !== "darwin",
|
|
||||||
},
|
|
||||||
async function fetchForceHttp2OnHttp1Server() {
|
async function fetchForceHttp2OnHttp1Server() {
|
||||||
const client = Deno.createHttpClient({ http2: true, http1: false });
|
const client = Deno.createHttpClient({ http2: true, http1: false });
|
||||||
await assertRejects(
|
await assertRejects(
|
||||||
() => fetch("http://localhost:5548/http_version", { client }),
|
() => fetch("http://localhost:5548/http_version", { client }),
|
||||||
TypeError,
|
TypeError,
|
||||||
"stream closed because of a broken pipe",
|
|
||||||
);
|
);
|
||||||
client.close();
|
client.close();
|
||||||
},
|
},
|
||||||
|
|
11
cli/tsc/dts/lib.deno.unstable.d.ts
vendored
11
cli/tsc/dts/lib.deno.unstable.d.ts
vendored
|
@ -826,9 +826,16 @@ declare namespace Deno {
|
||||||
/** Set an optional timeout for idle sockets being kept-alive.
|
/** Set an optional timeout for idle sockets being kept-alive.
|
||||||
* Set to false to disable the timeout. */
|
* Set to false to disable the timeout. */
|
||||||
poolIdleTimeout?: number | false;
|
poolIdleTimeout?: number | false;
|
||||||
/** Whether HTTP/1.1 is allowed or not. */
|
/**
|
||||||
|
* Whether HTTP/1.1 is allowed or not.
|
||||||
|
*
|
||||||
|
* @default {true}
|
||||||
|
*/
|
||||||
http1?: boolean;
|
http1?: boolean;
|
||||||
/** Whether HTTP/2 is allowed or not. */
|
/** Whether HTTP/2 is allowed or not.
|
||||||
|
*
|
||||||
|
* @default {true}
|
||||||
|
*/
|
||||||
http2?: boolean;
|
http2?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue