diff options
author | Luca Casonato <hello@lcas.dev> | 2021-06-26 00:01:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-26 00:01:25 +0200 |
commit | 40b083c540b90766ea746fc869bf8ea9634eaf06 (patch) | |
tree | a7a0fa8ce30aff1a80b902165b046105e1fe153f /runtime/js | |
parent | e86c1710f4684a1896950894850695ee59d1f61f (diff) |
fix: specify AbortSignal for native http requests (#11126)
Diffstat (limited to 'runtime/js')
-rw-r--r-- | runtime/js/40_http.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/js/40_http.js b/runtime/js/40_http.js index 63f64545f..5aa57238b 100644 --- a/runtime/js/40_http.js +++ b/runtime/js/40_http.js @@ -8,6 +8,7 @@ const errors = window.__bootstrap.errors.errors; const core = window.Deno.core; const { ReadableStream } = window.__bootstrap.streams; + const abortSignal = window.__bootstrap.abortSignal; function serveHttp(conn) { const rid = Deno.core.opSync("op_http_start", conn.rid); @@ -72,7 +73,8 @@ headersList, body !== null ? new InnerBody(body) : null, ); - const request = fromInnerRequest(innerRequest, null, "immutable"); + const signal = abortSignal.newSignal(); + const request = fromInnerRequest(innerRequest, signal, "immutable"); const respondWith = createRespondWith(this, responseSenderRid); |