send headers after checking for HEAD request and empty request