Avoid a file descriptor leak when reading files from disk and the HTTP client drops or times out
Prefer early returns in error conditions