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