summaryrefslogtreecommitdiff
path: root/ext/http/01_http.js
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-04-25 22:50:29 +0530
committerGitHub <noreply@github.com>2022-04-25 19:20:29 +0200
commit609c359dd448f2a7736ba1d93e94e1feff6acadc (patch)
tree284387075ed07627cff88f2cdba7bb5811dca7e5 /ext/http/01_http.js
parentc0e3b6096d37e9a4243c7ad461487db291c824fa (diff)
fix(ext/http): truncate read bytes when streaming bodies (#14389)
stream shutdown wasn't happening correctly (moved it to call op_http_shutdown) & extra zeroed bytes were being sent for when body length not a multiple of 64*1024
Diffstat (limited to 'ext/http/01_http.js')
-rw-r--r--ext/http/01_http.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/http/01_http.js b/ext/http/01_http.js
index 152241522..5c9deb5a3 100644
--- a/ext/http/01_http.js
+++ b/ext/http/01_http.js
@@ -318,13 +318,13 @@
throw error;
}
}
+ }
- try {
- await core.opAsync("op_http_shutdown", streamRid);
- } catch (error) {
- await reader.cancel(error);
- throw error;
- }
+ try {
+ await core.opAsync("op_http_shutdown", streamRid);
+ } catch (error) {
+ await reader.cancel(error);
+ throw error;
}
}