Skip to content

Commit cdc8ec3

Browse files
committed
fix: Call the parent end method and close the request in final
1 parent 9b9d354 commit cdc8ec3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/lib/request/adapters/http.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ class HttpWritableStream extends Stream.Writable {
5454
this.request.write(chunk, encoding, cb);
5555
}
5656

57-
end(chunk) {
58-
if (chunk) {
59-
this.request.write(chunk);
60-
} else {
61-
this.request.end();
62-
}
63-
57+
end(chunk?: any, encoding?: any, cb?: any): this {
58+
super.end(chunk, encoding, cb);
6459
return this;
6560
}
61+
62+
_final(cb: (error?: Error | null | undefined) => void): void {
63+
this.request.end();
64+
cb();
65+
}
6666
}
6767

6868
/**

0 commit comments

Comments
 (0)