mirror of
https://github.com/denoland/deno.git
synced 2024-12-01 16:51:13 -05:00
enable another test case
This commit is contained in:
parent
0467865e17
commit
e60e727e5e
2 changed files with 8 additions and 9 deletions
|
@ -15,7 +15,7 @@ import { TextEncoder } from "ext:deno_web/08_text_encoding.js";
|
|||
import { setTimeout } from "ext:deno_web/02_timers.js";
|
||||
import {
|
||||
_normalizeArgs,
|
||||
createConnection as netCreateConnection,
|
||||
createConnection,
|
||||
ListenOptions,
|
||||
Socket,
|
||||
} from "node:net";
|
||||
|
@ -414,7 +414,7 @@ class ClientRequest extends OutgoingMessage {
|
|||
}
|
||||
} else {
|
||||
debug("CLIENT use net.createConnection", optsWithoutSignal);
|
||||
this.onSocket(netCreateConnection(optsWithoutSignal));
|
||||
this.onSocket(createConnection(optsWithoutSignal));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -641,12 +641,13 @@ class ClientRequest extends OutgoingMessage {
|
|||
if (chunk) {
|
||||
this.write_(chunk, encoding, null, true);
|
||||
} else if (!this._headerSent) {
|
||||
if (this.socket && !this.socket.connecting) {
|
||||
if (
|
||||
(this.socket && !this.socket.connecting) || // socket is not connecting, or
|
||||
(!this.socket && this.outputData.length === 0) // no data to send
|
||||
) {
|
||||
this._contentLength = 0;
|
||||
this._implicitHeader();
|
||||
this._send("", "latin1");
|
||||
} else {
|
||||
//
|
||||
}
|
||||
}
|
||||
if (this.socket && this._bodyWriter) {
|
||||
|
@ -696,6 +697,7 @@ class ClientRequest extends OutgoingMessage {
|
|||
}
|
||||
this.aborted = true;
|
||||
this.emit("abort");
|
||||
//process.nextTick(emitAbortNT, this);
|
||||
this.destroy();
|
||||
}
|
||||
|
||||
|
|
|
@ -665,9 +665,7 @@ Deno.test("[node/http] server unref", async () => {
|
|||
assertEquals(statusCode, 0);
|
||||
});
|
||||
|
||||
Deno.test("[node/http] ClientRequest handle non-string headers", {
|
||||
ignore: true,
|
||||
}, async () => {
|
||||
Deno.test("[node/http] ClientRequest handle non-string headers", async () => {
|
||||
// deno-lint-ignore no-explicit-any
|
||||
let headers: any;
|
||||
const { promise, resolve, reject } = Promise.withResolvers<void>();
|
||||
|
@ -709,7 +707,6 @@ Deno.test("[node/http] ClientRequest uses HTTP/1.1", {
|
|||
req.once("error", (e) => reject(e));
|
||||
req.end();
|
||||
await promise;
|
||||
console.log(body);
|
||||
assertEquals(body, "HTTP/1.1");
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue