Compare commits

..

2 Commits

2 changed files with 129 additions and 125 deletions

4
mod.ts
View File

@ -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() {