summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--std/http/server.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/std/http/server.ts b/std/http/server.ts
index 4d9f70723..df5d1ff72 100644
--- a/std/http/server.ts
+++ b/std/http/server.ts
@@ -21,9 +21,14 @@ export class ServerRequest {
conn!: Deno.Conn;
r!: BufReader;
w!: BufWriter;
- done: Deferred<Error | undefined> = deferred();
+ #done: Deferred<Error | undefined> = deferred();
private _contentLength: number | undefined | null = undefined;
+
+ get done(): Promise<Error | undefined> {
+ return this.#done.then((e) => e);
+ }
+
/**
* Value of Content-Length header.
* If null, then content length is invalid or not given (e.g. chunked encoding).
@@ -93,7 +98,7 @@ export class ServerRequest {
}
// Signal that this request has been processed and the next pipelined
// request on the same connection can be accepted.
- this.done.resolve(err);
+ this.#done.resolve(err);
if (err) {
// Error during responding, rethrow.
throw err;