diff options
author | Samrith Shankar <samrith-s@users.noreply.github.com> | 2020-03-20 14:38:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-20 09:38:34 -0400 |
commit | 798904b0f2ed0c7284b67bba2f125f406b5850de (patch) | |
tree | 5aba8d35aa8984aa778c894258bcaed56f1ce17c /std/http/file_server.ts | |
parent | 35f6e2e45ddb96524a6bdf54b0a6155caa88d5e0 (diff) |
Add require-await lint rule (#4401)
Diffstat (limited to 'std/http/file_server.ts')
-rwxr-xr-x | std/http/file_server.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/std/http/file_server.ts b/std/http/file_server.ts index 18a68aa49..20d5d61e6 100755 --- a/std/http/file_server.ts +++ b/std/http/file_server.ts @@ -158,17 +158,17 @@ async function serveDir( return res; } -async function serveFallback(req: ServerRequest, e: Error): Promise<Response> { +function serveFallback(req: ServerRequest, e: Error): Promise<Response> { if (e instanceof Deno.errors.NotFound) { - return { + return Promise.resolve({ status: 404, body: encoder.encode("Not found") - }; + }); } else { - return { + return Promise.resolve({ status: 500, body: encoder.encode("Internal server error") - }; + }); } } |