Fixes logger that failed after error handling
Test fix related to responding empty request

Commit 1bb8c56da made the handler to close the connection without
sending anything if the client sent nothing.  This fix aligns the test
with it.