catch issue where the connection was closed before reply
This commit is contained in:
parent
5626782178
commit
1c085b9ec5
4
mod.ts
4
mod.ts
|
@ -102,6 +102,7 @@ export class HTTPServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async handleHttp(conn: Deno.Conn) {
|
private async handleHttp(conn: Deno.Conn) {
|
||||||
|
try {
|
||||||
const httpConn = Deno.serveHttp(conn);
|
const httpConn = Deno.serveHttp(conn);
|
||||||
for await (const requestEvent of httpConn) {
|
for await (const requestEvent of httpConn) {
|
||||||
const filepath = decodeURIComponent(
|
const filepath = decodeURIComponent(
|
||||||
|
@ -242,6 +243,9 @@ export class HTTPServer {
|
||||||
}
|
}
|
||||||
this.handleNotFound(routeRequest, routeReply, requestEvent);
|
this.handleNotFound(routeRequest, routeReply, requestEvent);
|
||||||
}
|
}
|
||||||
|
} catch (_err) {
|
||||||
|
// Ignore http that where closed before reply was sent
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
|
|
Reference in New Issue
Block a user