Skip to content
This repository was archived by the owner on Jan 19, 2022. It is now read-only.

Commit 6c9a13b

Browse files
author
David Acevedo
authored
Eliminating redundancy
1 parent 5873646 commit 6c9a13b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

httpserver/bin/mini_file_server.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,14 @@ Future main() async {
3232
req.response.headers.contentType = ContentType.html;
3333
try {
3434
await req.response.addStream(targetFile.openRead());
35-
await req.response.close();
3635
} catch (e) {
3736
print("Couldn't read file: $e");
3837
exit(-1);
3938
}
4039
} else {
4140
print("Can't open ${targetFile.path}.");
4241
req.response.statusCode = HttpStatus.notFound;
43-
await req.response.close();
4442
}
43+
await req.response.close();
4544
}
4645
}

0 commit comments

Comments
 (0)