summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/http/response_body.rs2
-rw-r--r--ext/node/polyfills/http.ts7
2 files changed, 4 insertions, 5 deletions
diff --git a/ext/http/response_body.rs b/ext/http/response_body.rs
index fd1203f53..3c25265d7 100644
--- a/ext/http/response_body.rs
+++ b/ext/http/response_body.rs
@@ -394,7 +394,7 @@ impl PollFrame for GZipResponseStream {
stm.compress(&[], &mut buf, flate2::FlushCompress::Finish)
}
ResponseStreamResult::NonEmptyBuf(mut input) => {
- let res = stm.compress(&input, &mut buf, flate2::FlushCompress::None);
+ let res = stm.compress(&input, &mut buf, flate2::FlushCompress::Sync);
let len_in = (stm.total_in() - start_in) as usize;
debug_assert!(len_in <= input.len());
this.crc.update(&input[..len_in]);
diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts
index 6b862ce83..ec3fe6e0b 100644
--- a/ext/node/polyfills/http.ts
+++ b/ext/node/polyfills/http.ts
@@ -671,6 +671,9 @@ class ClientRequest extends OutgoingMessage {
(async () => {
try {
const res = await op_fetch_send(this._req.requestRid);
+ if (this._req.cancelHandleRid !== null) {
+ core.tryClose(this._req.cancelHandleRid);
+ }
try {
cb?.();
} catch (_) {
@@ -709,10 +712,6 @@ class ClientRequest extends OutgoingMessage {
Object.entries(res.headers).flat().length,
);
- if (this._req.cancelHandleRid !== null) {
- core.tryClose(this._req.cancelHandleRid);
- }
-
if (incoming.upgrade) {
if (this.listenerCount("upgrade") === 0) {
// No listeners, so we got nothing to do