vweb: fix the `none` error for empty TCP connections (#9759)

pull/9765/head
William Clavier 2021-04-16 01:45:46 -04:00 committed by GitHub
parent 60bc280ad0
commit b11b744630
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -321,7 +321,10 @@ fn handle_conn<T>(mut conn net.TcpConn, mut app T) {
} }
page_gen_start := time.ticks() page_gen_start := time.ticks()
req := parse_request(mut reader) or { req := parse_request(mut reader) or {
// Prevents errors from being thrown when BufferedReader is empty
if '$err' != 'none' {
eprintln('error parsing request: $err') eprintln('error parsing request: $err')
}
return return
} }
app.Context = Context{ app.Context = Context{