Added test coverage for sendHeaders, but headers can not be tested in CLI